mirror of
https://github.com/boostorg/move.git
synced 2025-07-31 21:04:27 +02:00
Add checks to detect self-move operations
This commit is contained in:
@@ -87,11 +87,13 @@ struct order_move_type
|
||||
order_move_type(BOOST_RV_REF(order_move_type) other)
|
||||
: key(other.key), val(other.val)
|
||||
{
|
||||
BOOST_ASSERT(this != &other);
|
||||
other.key = other.val = std::size_t(-1);
|
||||
}
|
||||
|
||||
order_move_type & operator=(BOOST_RV_REF(order_move_type) other)
|
||||
{
|
||||
BOOST_ASSERT(this != &other);
|
||||
key = other.key;
|
||||
val = other.val;
|
||||
other.key = other.val = std::size_t(-2);
|
||||
|
Reference in New Issue
Block a user