l******e 发帖数: 94 | 1 1. Assignment operation on classes - If I assign a class instance to another
class instance A = B What code execute ( i.e. to deal with the assignment
operator what code would the compiler have generated)?
2. Suppose there is a class dealing with memory allocations and
deallocations. It has methods to allocate/deallocate memory. Now the class
uses some memory for its implementation - for example its own metadata
maintenance. Where, in code, would I deallocate that memory? | T********r 发帖数: 6210 | 2
another
assignment
constructor
class
destructor
【在 l******e 的大作中提到】 : 1. Assignment operation on classes - If I assign a class instance to another : class instance A = B What code execute ( i.e. to deal with the assignment : operator what code would the compiler have generated)? : 2. Suppose there is a class dealing with memory allocations and : deallocations. It has methods to allocate/deallocate memory. Now the class : uses some memory for its implementation - for example its own metadata : maintenance. Where, in code, would I deallocate that memory?
| l******e 发帖数: 94 | 3 can you say some details about 1 ? and should it be constructor or copy
constructor?
【在 T********r 的大作中提到】 : : another : assignment : constructor : class : destructor
|
|