typedef X element_type;
explicit auto_ptr(X* p =0) throw() : px(p) {}
- auto_ptr(auto_ptr& r) throw() : px(r.release()) {}
+ auto_ptr(auto_ptr& r) throw() : px(r.release()) {} // ERROR - candidate
template<typename Y>
- auto_ptr(auto_ptr<Y>& r) throw() : px(r.release()) {}
+ auto_ptr(auto_ptr<Y>& r) throw() : px(r.release()) {}// ERROR - candidate
auto_ptr& operator=(auto_ptr& r) throw() {
reset(r.release());
X* release() throw() { X* p=px; px=0; return p; }
void reset(X* p=0) throw() { if (px != p) delete px, px = p; }
- auto_ptr(auto_ptr_ref<X> r) throw() : px(r.py) {}
+ auto_ptr(auto_ptr_ref<X> r) throw() : px(r.py) {} // ERROR - candidate
template<typename Y> operator auto_ptr_ref<Y>() throw() {
return auto_ptr_ref<Y>(release());
}
auto_ptr<Derived> y(f());
x = y;
g(f());
- h(f());
+ h(f()); // ERROR - no usable copy ctor
}