tac
Explore posts from serversMModular
•Created by tac on 9/12/2023 in #questions
__moveinit__ and __del__
When the
__del__
method is not implemented, the __moveinit__
method is less likely to be invoked. Why is this the case? Consider the following example code:
On execution, the output is:
However, when we include the __del__
method as follows:
The output changes to:
The presence or absence of the __del__
method impacts the sequence of method calls __copyinit__
and __moveinit__
, potentially affecting the performance. Why does this occur?14 replies