|
-
June 19th, 2008, 03:22 PM
#6
Re: Rule of 3 for a simple class...
 Originally Posted by Richard.J
what exactly is the rule of three? I can't google a satisfying explanation ;-)
If any one of the compiler-generated destructor, copy constructor or copy assignment operator are inappropriate for a class, then it is likely that all three will compiler-generated functions will be inappropriate. The writer of the class would then be required to write their own or disable them.
Note that in modern C++ with the use of other classes that manage resources themselves it is less likely that the rule of three will apply to a well-written class.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|