From 3ebdc9730cca1581b771b15d188eb579d7dcbef4 Mon Sep 17 00:00:00 2001 From: Christian Mazakas Date: Thu, 31 Aug 2023 14:08:17 -0700 Subject: [PATCH] Remove BOOST_COPYABLE_AND_MOVABLE --- include/boost/unordered/unordered_map.hpp | 19 ++++--------------- include/boost/unordered/unordered_set.hpp | 19 ++++--------------- test/objects/test.hpp | 1 - test/unordered/noexcept_tests.cpp | 6 ------ test/unordered/unnecessary_copy_tests.cpp | 2 -- 5 files changed, 8 insertions(+), 39 deletions(-) diff --git a/include/boost/unordered/unordered_map.hpp b/include/boost/unordered/unordered_map.hpp index 5a2e3321..1a65b5d4 100644 --- a/include/boost/unordered/unordered_map.hpp +++ b/include/boost/unordered/unordered_map.hpp @@ -41,9 +41,6 @@ namespace boost { namespace unordered { template class unordered_map { -#if defined(BOOST_UNORDERED_USE_MOVE) - BOOST_COPYABLE_AND_MOVABLE(unordered_map) -#endif template friend class unordered_multimap; @@ -689,9 +686,6 @@ namespace boost { template class unordered_multimap { -#if defined(BOOST_UNORDERED_USE_MOVE) - BOOST_COPYABLE_AND_MOVABLE(unordered_multimap) -#endif template friend class unordered_map; @@ -2175,8 +2169,6 @@ namespace boost { template class node_handle_map { - BOOST_MOVABLE_BUT_NOT_COPYABLE(node_handle_map) - template friend struct ::boost::unordered::detail::table; template friend class boost::unordered::unordered_map; @@ -2208,6 +2200,8 @@ namespace boost { public: constexpr node_handle_map() noexcept : ptr_(), alloc_() {} + node_handle_map(node_handle_map const&) = delete; + node_handle_map& operator=(node_handle_map const&) = delete; ~node_handle_map() { @@ -2296,19 +2290,14 @@ namespace boost { template struct insert_return_type_map { - private: - BOOST_MOVABLE_BUT_NOT_COPYABLE(insert_return_type_map) - - // typedef typename boost::allocator_rebind >::type value_allocator; - // typedef N node_; - public: Iter position; bool inserted; NodeType node; insert_return_type_map() : position(), inserted(false), node() {} + insert_return_type_map(insert_return_type_map const&) = delete; + insert_return_type_map& operator=(insert_return_type_map const&) = delete; insert_return_type_map(insert_return_type_map&& x) noexcept : position(x.position), diff --git a/include/boost/unordered/unordered_set.hpp b/include/boost/unordered/unordered_set.hpp index db5fc3cd..8a55f48f 100644 --- a/include/boost/unordered/unordered_set.hpp +++ b/include/boost/unordered/unordered_set.hpp @@ -40,9 +40,6 @@ namespace boost { namespace unordered { template class unordered_set { -#if defined(BOOST_UNORDERED_USE_MOVE) - BOOST_COPYABLE_AND_MOVABLE(unordered_set) -#endif template friend class unordered_multiset; @@ -536,9 +533,6 @@ namespace boost { template class unordered_multiset { -#if defined(BOOST_UNORDERED_USE_MOVE) - BOOST_COPYABLE_AND_MOVABLE(unordered_multiset) -#endif template friend class unordered_set; @@ -1803,8 +1797,6 @@ namespace boost { template class node_handle_set { - BOOST_MOVABLE_BUT_NOT_COPYABLE(node_handle_set) - template friend struct ::boost::unordered::detail::table; template friend class unordered_set; @@ -1838,6 +1830,8 @@ namespace boost { public: constexpr node_handle_set() noexcept : ptr_(), has_alloc_(false) {} + node_handle_set(node_handle_set const&) = delete; + node_handle_set& operator=(node_handle_set const&) = delete; ~node_handle_set() { @@ -1918,19 +1912,14 @@ namespace boost { template struct insert_return_type_set { - private: - BOOST_MOVABLE_BUT_NOT_COPYABLE(insert_return_type_set) - - // typedef typename boost::unordered::detail::rebind_wrap::type - // value_allocator; - // typedef N node_; - public: Iter position; bool inserted; NodeType node; insert_return_type_set() : position(), inserted(false), node() {} + insert_return_type_set(insert_return_type_set const&) = delete; + insert_return_type_set& operator=(insert_return_type_set const&) = delete; insert_return_type_set(insert_return_type_set&& x) noexcept : position(x.position), diff --git a/test/objects/test.hpp b/test/objects/test.hpp index 9786a731..07f17156 100644 --- a/test/objects/test.hpp +++ b/test/objects/test.hpp @@ -96,7 +96,6 @@ namespace test { friend class less; int tag1_, tag2_; - BOOST_COPYABLE_AND_MOVABLE(movable) public: explicit movable(int t1 = 0, int t2 = 0) : tag1_(t1), tag2_(t2) {} diff --git a/test/unordered/noexcept_tests.cpp b/test/unordered/noexcept_tests.cpp index bbe5a1a1..2e7353c8 100644 --- a/test/unordered/noexcept_tests.cpp +++ b/test/unordered/noexcept_tests.cpp @@ -57,8 +57,6 @@ namespace noexcept_tests { bool nothrow_swap> class hash_nothrow : boost::hash { - BOOST_COPYABLE_AND_MOVABLE(hash_nothrow) - typedef boost::hash base; public: @@ -105,8 +103,6 @@ namespace noexcept_tests { bool nothrow_swap> class equal_to_nothrow { - BOOST_COPYABLE_AND_MOVABLE(equal_to_nothrow) - typedef boost::hash base; public: @@ -356,7 +352,6 @@ namespace noexcept_tests { template class allocator1 { - BOOST_COPYABLE_AND_MOVABLE(allocator1) allocator1 operator=(allocator1 const&); allocator1 operator=(allocator1&&); @@ -382,7 +377,6 @@ public: template class allocator2 { - BOOST_COPYABLE_AND_MOVABLE(allocator2) allocator2 operator=(allocator2 const&); public: diff --git a/test/unordered/unnecessary_copy_tests.cpp b/test/unordered/unnecessary_copy_tests.cpp index bd267653..2f385cb5 100644 --- a/test/unordered/unnecessary_copy_tests.cpp +++ b/test/unordered/unnecessary_copy_tests.cpp @@ -15,8 +15,6 @@ namespace unnecessary_copy_tests { struct count_copies { - private: - BOOST_COPYABLE_AND_MOVABLE(count_copies) public: static int copies; static int moves;