Enginuity

Started by
1 comment, last by drkpriest 19 years, 8 months ago
I just recently started reading Enginuity and I'm up to the Smart Pointers part. There is something I don't quite understand. In the copy constructors he has this: //Constructing with a pointer CMMPointer(T *o) { obj=0; *this=o; } //Constructing with another smart pointer (copy constructor) CMMPointer(const CMMPointer<T> &p) { obj=0; *this=p; } How come he doesn't call the AddRef() method here? When in the =assignment overloads he does.
Advertisement
*this = p; will call the assignment operator for CMMPointer.
Oh der! Thanks. Man, I gotta start going to bed again :S

This topic is closed to new replies.

Advertisement