
On January 21, 2013 11:27:36 PM Sergey Cheban <s.cheban@drweb.com> wrote:
II: Set operand.p_ to NULL, add BOOST_ASSERT in get operations + good performance + provides noexcept guarantee for move constructor + optimization will be used even if varinat has no type with trivial default constructor + easy to implement - triggers an assert when user tries to reuse moved object - adds an empty state to the recursive_wrapper Let's think about non-recursive variants. For example:
// both CFileObj and CDatabaseObj are movable, not copyable and // not nothrow-default-constructible boost::variant< CFileObj, CDatabaseObj > v1( CFileObj(SomeFileName) ); boost::variant< CFileObj, CDatabaseObj > v2( std::move( v1 ) );
// What would be the state of v1 at this point?
Moved-from CFileObj, I presume.