Subject: [boost] [move] interest: the pass-by-value and swap idiom, and explicit copy constructors
From: Krzysztof Czainski (1czajnik_at_[hidden])
Date: 2014-02-14 11:52:53
I would like to ask about interest in an idea of mine. I described it in
detail  and implemented it as part of my cz libraries .
In short, the idea presents:
- an alternative to implicitly copyable and movable types: making them
- a protocol for explicitly stating in code, where a copy is to be made
(boost::copy()), which compliments the protocol for explicitly stating in
code, where a move is allowed (std::move() or boost::move());
- a Boost.move extension for implementing movable types with use of the
pass-by-value and swap idiom, backwards-compatible with C++98, which allows
to choose copying policies (and eases changing between these policies
- movable but not copyable,
- movable and explicitly-copyable,
- movable and copyable;
- an example, showing how simply a CloneablePtr can thereby be implemented.
This extension to Boost.move is hosted and developed as part of my cz
libraries , but it isn't tied to them at all. It only consists of two
headers. I extracted the two headers together with samples and docs, and
they are available as a zip archive .
I would be most excited if there was interest in adding this functionality
to Boost.move, but in any case, all comments are much appreciated.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk