
on Sun Dec 07 2008, "Emil Dotchevski" <emil-AT-revergestudios.com> wrote:
On Sat, Dec 6, 2008 at 4:42 PM, David Abrahams <dave@boostpro.com> 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 & );
The type playing the role of handle in this case (at least according to the traditional meaning of "handle") is shared_ptr<handle>, which is both movable and copyable. Also the incompleteness of the struct is usually "otherwise justified" in such a case. -- Dave Abrahams BoostPro Computing http://www.boostpro.com