If I have a class
template <typename T>
struct C {
...
private:
auto_ptr<T> ptr;
};
How do I define the copy constructor for C:
It cannot be
template <typename T>
C<T>::C(const C& other)
because I want to if I copy the auto_ptr from other, I have changed other by removing ownership. Is it legal to define a copy constructor as
template <typename T>
C<T>::C(C& other) {}