Boost logo

Boost :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2001-06-27 17:02:01


----- Original Message -----
From: <williamkempf_at_[hidden]>

> These are all syntactic variations on one design (as you know), and
> the key to focus on here is the syntax using the shared_ptr. This
> gives us creation syntax like this:
>
> shared_ptr<thread> p(thread::create(proc));
>
> This is nearly identical to the more intuitive syntax:
>
> shared_ptr<thread> p(new thread(proc));
>
> In other words, I see absolutely no benefit to this third design.

Not having followed carefully, let me say this: I assume from the above that
the thread resource must be managed. It is always safer to have an interface
that returns a managed resource (e.g. std::auto_ptr<thread>) than to require
a user to create an unmanaged pointer in such cases.

-Dave


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