From dfe3ffa8e2778000a0c687cc98d12edb961bd53e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Tue, 23 Aug 2022 07:56:57 +0200 Subject: [PATCH] Add checks to detect self-move operations --- test/order_type.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/order_type.hpp b/test/order_type.hpp index e505b60..75115f3 100644 --- a/test/order_type.hpp +++ b/test/order_type.hpp @@ -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);