Talk:Policies/Library Code Policy: Difference between revisions

Page contents not supported in other languages.
From KDE TechBase
No edit summary
 
Line 1: Line 1:
== D Pointers ==
== D Pointers ==
It should be mentioned, that when using d-pointers, the copy constructor and assignment operator either have to be implemented correctly or they have to be forbidden. The implicit copy constructor and assignment operator copy just the value of the pointer. The pointer to the former Private data will get lost (memory leakage). By declaring the d pointer as const, the assignment is actually no problem, but it would be cleaner to declare the operator as private.
It should be mentioned, that when using d-pointers, the copy constructor and assignment operator either have to be implemented correctly or they have to be forbidden. The implicit copy constructor and assignment operator copy just the value of the pointer. The pointer to the former Private data will get lost (memory leakage).

Revision as of 20:05, 29 January 2007

D Pointers

It should be mentioned, that when using d-pointers, the copy constructor and assignment operator either have to be implemented correctly or they have to be forbidden. The implicit copy constructor and assignment operator copy just the value of the pointer. The pointer to the former Private data will get lost (memory leakage).