This is needed to ensure a copy does what you want, otherwise when you make a copy of an object of this type, the destination auto_ptr member will take ownership from the source object. The compiler won't complain, but most likely your class won't do what you expect. If you define a copy constructor, the compiler will not provide a default construct. You will have to provide your own.
Reference: More Exceptional C++
No comments:
Post a Comment