Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2001-04-05 11:13:00


From: "Gary Powell" <Gary.Powell_at_[hidden]>

> Hi Peter,
>
> I emailed way too quick. My B.S. "C++ Programming Language" 3rd Ed. 5th
> printing book, section 14.4.2 says "auto_ptr_ref is to implement the
> destructive copy semantics for ordinary auto_ptrs while making it
impossible
> to copy a const auto_ptr."
>
> Is there another way to ensure this constraint?

AFAIK auto_ptr_ref supports passing/returning auto_ptrs by value. I think
that this is unnecessary for boost::auto_ptr, since (1) we have
boost::shared_ptr for this, (2) passing auto_ptrs by value instead of
non-const reference is dangerous (exception safety), and (3) returning
std::auto_ptrs by value is sometimes useful since std::auto_ptr is standard,
but boost::auto_ptr is not, so it doesn't need this "capability."

--
Peter Dimov
Multi Media Ltd.

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