14 Feb
2018
14 Feb
'18
10:03 p.m.
AMDG On 02/14/2018 02:48 PM, Nevin Liber via Boost wrote:
On Wed, Feb 14, 2018 at 3:18 PM, Miguel Ojeda via Boost < boost@lists.boost.org> wrote:
IMO, such a class is definitely useful.
Design concerns:
- unique_val should be copyable if T is copyable. Whether or not a type which aggregates this is copyable is an orthogonal, separate concern from what the moved-from state should be. If you go this route, unique_val is the wrong name.
That completely subverts the point of using unique_val in the first place, which is that you have some cleanup operation that needs to be applied exactly once, when your done with the object. This is most common when dealing with C API's where everything is copyable. In Christ, Steven Watanabe