Boost logo

Boost :

From: David Abrahams (abrahams_at_[hidden])
Date: 2001-01-06 13:28:04


----- Original Message -----
From: "Howard Hinnant" <hinnant_at_[hidden]>

> I'm up to requiring this in the primary:
>
> private:
> X* ptr_;
> template<class Y> auto_ptr(auto_ptr<Y[]>& a) throw();
> template<class Y> operator auto_ptr<Y[]>() throw();
> template<class Y> auto_ptr& operator=(auto_ptr<Y[]>&) throw();
> template<class Y> operator auto_ptr_ref<Y[]>() throw();
>
> And at the risk of being too clever, I renamed auto_ptr_array_ref to:
>
> template <class Y>
> struct auto_ptr_ref<Y[]>
> {
> Y* ptr_;
> };
>
> And have the specialization refer to auto_ptr_ref<X[]> instead of
> auto_ptr_ref<X>. I believe it has the same effect.

Looks right to me. I think if you weren't being so clever , the last
declaration in the primary wouldn't be needed, but the difference between 3
and 4 is practically 0 ;-)

-Dave


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk