Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2002-09-17 08:15:39


From: "David Abrahams" <dave_at_[hidden]>
> - The smart pointer common requirements documentation mentions that T must
> be complete "at points of smart pointer instantiation". I think it might
be
> helpful to users if we briefly explain what that means (will "at the point
> when the compiler requires knowledge of any of the smart pointer's members
> or bases" do?). It also might be /very/ nice to mention here that
> shared_ptr doesn't have these restrictions, since it's the most popular
and
> general-purpose of the smart pointers.

It seems to me that the requirement, as stated, is too strict even for
scoped_ptr. A scoped_ptr<T> can be instantiated with T being an incomplete
type:

class X;

class Y
{
public:

    Y();
    ~Y();

private:

    scoped_ptr<X> px;
};

Y y; // scoped_ptr<X> instantiated here


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