Subject: [Boost-bugs] [Boost C++ Libraries] #7418: Copyable and explicitly movable classes
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-09-24 22:19:11
#7418: Copyable and explicitly movable classes
------------------------------+---------------------------------------------
Reporter: danieljames | Owner: igaztanaga
Type: Feature Requests | Status: new
Milestone: To Be Determined | Component: move
Version: Boost 1.52.0 | Severity: Problem
Keywords: |
------------------------------+---------------------------------------------
Making a class movable can have some unfortunate side effects, as far as I
know these are all due to implementing implicit moves. So if possible,
it's be useful to have a class where the move mechanism only kicks in when
boost::move is explicitly used. This could be efficient for cases where
the class is explicitly moved (e.g. in a move enable vector), but avoid
the potential problems.
I believe that this could be done by defining just the move construct and
move assignment, but with no implicit conversions or other special
functions. Then the main difficultly is modifying the
`has_move_emulation_enabled` trait to support these types. Maybe the class
could have a magic member typedef which is detected by sfinae, or maybe
you can come up with something better.
Does this sound like a good idea? I haven't tried implementing it, so I
might be missing some problem with the idea.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/7418> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:10 UTC