Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2002-05-18 03:55:15


From: "William E. Kempf" <williamkempf_at_[hidden]>
>
> template <typename Mutex>
> class scoped_lock : private noncopyable

[...]

> Usage:
>
> boost::mutex mutex;
>
> boost::mutex::scoped_lock transfer_lock_out()

Doesn't work... Noncopyables cannot be returned by value. You need an
auto_ptr-style monstrosity, operator scoped_lock_ref() etc. Move semantics
simply aren't adequately supported by the (current) language. C++0x may do
better. Another consequence is that a wrapper class with a shared_ptr member
automatically acquires shared semantics, but a class with an auto_ptr member
will _not_ have full move semantics unless the necessary hackery is
duplicated.


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