Access Menu

Site Navigation

« To not to communicate | Main | Dutch handicap »

January 21, 2006

Rule of three ~ C/C++

If your class needs a destructor, it probably needs a copy destructor and an assignment operator too. In other words, you can look at it this way:

T::T()
T::~T()
T::T(const T&)
T::operator=(const T&)

In the long run it is probably a better idea to make it a habit always to include all of these for a given class, just in case.

Posted at 9:57 PM

Trackback Pings

TrackBack URL for this entry:
http://www.kiffinsblog.com/cgi-bin/mt/mt-tb.cgi/231

0 Comment(s)

Post a comment

Thanks for signing in, . Now you can comment. (sign out)

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)


Remember me?