Boost logo

Boost :

Subject: Re: [boost] Composing non copyable and movable classes
From: Emil Dotchevski (emil_at_[hidden])
Date: 2008-12-07 02:07:54


On Sat, Dec 6, 2008 at 4:42 PM, David Abrahams <dave_at_[hidden]> wrote:
> This feels like overgeneralizing. Unless otherwise justified, every
> type should have value semantics, i.e., should be movable and copiable.

I find C-style incomplete type (and therefore non-copyable,
non-movable and non-value) handles quite practical too:

//foo.h
namespace boost { template <class> class shared_ptr; }
struct handle;
boost::shared_ptr<handle> create_handle();
void do_something( handle & );

Emil Dotchevski
Reverge Studios, Inc.
http://www.revergestudios.com/reblog/index.php?n=ReCode


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