25 Nov
2004
25 Nov
'04
9:54 a.m.
MenTaLguY wrote:
Rule of thumb with C++: if it's not a value class [a class in which binary copies of objects are interchangable], give it a private copy constructor like so:
Too subtle.
:-)
I'd say, rather, that a good rule of thumb is 'Always give a class a private copy constructor and operator ='.
In those cases where it's actually appropriate, then you can do exceptions to that rule.
Hmmm... or a slightly modified version could be
'Always give a class an explicit copy constructor and operator =, making them private unless you have good reason not to'
Perhaps that could be something to attack post-release?