From 95f5dba6f6077c05305ffde13753b1d892bd888b Mon Sep 17 00:00:00 2001 From: Christian Mazakas Date: Tue, 29 Aug 2023 14:57:07 -0700 Subject: [PATCH] Remove BOOST_UNORDERED_EMPLACE_LIMIT --- include/boost/unordered/detail/fwd.hpp | 8 - include/boost/unordered/unordered_map.hpp | 483 +--------------------- include/boost/unordered/unordered_set.hpp | 192 +-------- test/helpers/test.hpp | 2 - 4 files changed, 22 insertions(+), 663 deletions(-) diff --git a/include/boost/unordered/detail/fwd.hpp b/include/boost/unordered/detail/fwd.hpp index 61fbda78..8ab4cfdf 100644 --- a/include/boost/unordered/detail/fwd.hpp +++ b/include/boost/unordered/detail/fwd.hpp @@ -16,14 +16,6 @@ #include -// BOOST_UNORDERED_EMPLACE_LIMIT = The maximum number of parameters in -// emplace (not including things like hints). Don't set it to a lower value, as -// that might break something. - -#if !defined BOOST_UNORDERED_EMPLACE_LIMIT -#define BOOST_UNORDERED_EMPLACE_LIMIT 10 -#endif - //////////////////////////////////////////////////////////////////////////////// // Configuration // diff --git a/include/boost/unordered/unordered_map.hpp b/include/boost/unordered/unordered_map.hpp index 4e744b5b..31e43c3b 100644 --- a/include/boost/unordered/unordered_map.hpp +++ b/include/boost/unordered/unordered_map.hpp @@ -253,8 +253,7 @@ namespace boost { { return table_.emplace_unique( table::extractor::extract(std::forward(a0)), - boost::unordered::detail::create_emplace_args( - std::forward(a0))); + boost::unordered::detail::create_emplace_args(std::forward(a0))); } template @@ -262,8 +261,7 @@ namespace boost { BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1) { return table_.emplace_unique( - table::extractor::extract( - std::forward(a0), std::forward(a1)), + table::extractor::extract(std::forward(a0), std::forward(a1)), boost::unordered::detail::create_emplace_args( std::forward(a0), std::forward(a1))); } @@ -273,10 +271,9 @@ namespace boost { BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2) { return table_.emplace_unique( - table::extractor::extract( - std::forward(a0), std::forward(a1)), - boost::unordered::detail::create_emplace_args(std::forward(a0), - std::forward(a1), std::forward(a2))); + table::extractor::extract(std::forward(a0), std::forward(a1)), + boost::unordered::detail::create_emplace_args( + std::forward(a0), std::forward(a1), std::forward(a2))); } #endif @@ -310,8 +307,7 @@ namespace boost { { return table_.emplace_hint_unique(hint, table::extractor::extract(std::forward(a0)), - boost::unordered::detail::create_emplace_args( - std::forward(a0))); + boost::unordered::detail::create_emplace_args(std::forward(a0))); } template @@ -319,8 +315,7 @@ namespace boost { const_iterator hint, BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1) { return table_.emplace_hint_unique(hint, - table::extractor::extract( - std::forward(a0), std::forward(a1)), + table::extractor::extract(std::forward(a0), std::forward(a1)), boost::unordered::detail::create_emplace_args( std::forward(a0), std::forward(a1))); } @@ -330,50 +325,11 @@ namespace boost { BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2) { return table_.emplace_hint_unique(hint, - table::extractor::extract( - std::forward(a0), std::forward(a1)), - boost::unordered::detail::create_emplace_args(std::forward(a0), - std::forward(a1), std::forward(a2))); + table::extractor::extract(std::forward(a0), std::forward(a1)), + boost::unordered::detail::create_emplace_args( + std::forward(a0), std::forward(a1), std::forward(a2))); } -#endif - -#if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) - -#define BOOST_UNORDERED_EMPLACE(z, n, _) \ - template \ - std::pair emplace( \ - BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_FWD_PARAM, a)) \ - { \ - return table_.emplace_unique( \ - table::extractor::extract( \ - std::forward(a0), std::forward(a1)), \ - boost::unordered::detail::create_emplace_args( \ - BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_CALL_FORWARD, a))); \ - } \ - \ - template \ - iterator emplace_hint( \ - const_iterator hint, BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_FWD_PARAM, a)) \ - { \ - return table_.emplace_hint_unique(hint, \ - table::extractor::extract( \ - std::forward(a0), std::forward(a1)), \ - boost::unordered::detail::create_emplace_args( \ - BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_CALL_FORWARD, a))); \ - } - - BOOST_UNORDERED_EMPLACE(1, 4, _) - BOOST_UNORDERED_EMPLACE(1, 5, _) - BOOST_UNORDERED_EMPLACE(1, 6, _) - BOOST_UNORDERED_EMPLACE(1, 7, _) - BOOST_UNORDERED_EMPLACE(1, 8, _) - BOOST_UNORDERED_EMPLACE(1, 9, _) - BOOST_PP_REPEAT_FROM_TO(10, BOOST_PP_INC(BOOST_UNORDERED_EMPLACE_LIMIT), - BOOST_UNORDERED_EMPLACE, _) - -#undef BOOST_UNORDERED_EMPLACE - #endif std::pair insert(value_type const& x) @@ -462,8 +418,6 @@ namespace boost { public: #endif -#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) - template std::pair try_emplace( key_type const& k, BOOST_FWD_REF(Args)... args) @@ -515,270 +469,6 @@ namespace boost { hint, std::forward(k), std::forward(args)...); } -#else - - // In order to make this a template, this handles both: - // try_emplace(key const&) - // try_emplace(key&&) - - template - std::pair try_emplace(BOOST_FWD_REF(Key) k) - { - return table_.try_emplace_unique(std::forward(k)); - } - - // In order to make this a template, this handles both: - // try_emplace(const_iterator hint, key const&) - // try_emplace(const_iterator hint, key&&) - - template - iterator try_emplace(const_iterator hint, BOOST_FWD_REF(Key) k) - { - return table_.try_emplace_hint_unique(hint, std::forward(k)); - } - - // try_emplace(key const&, Args&&...) - - template - std::pair try_emplace( - key_type const& k, BOOST_FWD_REF(A0) a0) - { - return table_.try_emplace_unique( - k, boost::unordered::detail::create_emplace_args( - std::forward(a0))); - } - - template - std::pair try_emplace( - key_type const& k, BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1) - { - return table_.try_emplace_unique( - k, boost::unordered::detail::create_emplace_args( - std::forward(a0), std::forward(a1))); - } - - template - std::pair try_emplace(key_type const& k, - BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2) - { - return table_.try_emplace_unique(k, - boost::unordered::detail::create_emplace_args(std::forward(a0), - std::forward(a1), std::forward(a2))); - } - - // try_emplace(key&&, Args&&...) - - template - std::pair try_emplace( - BOOST_RV_REF(key_type) k, BOOST_FWD_REF(A0) a0) - { - return table_.try_emplace_unique( - std::move(k), boost::unordered::detail::create_emplace_args( - std::forward(a0))); - } - - template - std::pair try_emplace( - BOOST_RV_REF(key_type) k, BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1) - { - return table_.try_emplace_unique( - std::move(k), boost::unordered::detail::create_emplace_args( - std::forward(a0), std::forward(a1))); - } - - template - std::pair try_emplace(BOOST_RV_REF(key_type) k, - BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2) - { - return table_.try_emplace_unique(std::move(k), - boost::unordered::detail::create_emplace_args(std::forward(a0), - std::forward(a1), std::forward(a2))); - } - - // try_emplace(Key&&, Args&&...) - - template - typename boost::enable_if_c< - detail::transparent_non_iterable::value, - std::pair >::type - try_emplace(BOOST_FWD_REF(Key) k, BOOST_FWD_REF(A0) a0) - { - return table_.try_emplace_unique( - std::forward(k), boost::unordered::detail::create_emplace_args( - std::forward(a0))); - } - - template - typename boost::enable_if_c< - detail::transparent_non_iterable::value, - std::pair >::type - try_emplace( - BOOST_FWD_REF(Key) k, BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1) - { - return table_.try_emplace_unique(std::forward(k), - boost::unordered::detail::create_emplace_args( - std::forward(a0), std::forward(a1))); - } - - template - typename boost::enable_if_c< - detail::transparent_non_iterable::value, - std::pair >::type - try_emplace(BOOST_FWD_REF(Key) k, BOOST_FWD_REF(A0) a0, - BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2) - { - return table_.try_emplace_unique(std::forward(k), - boost::unordered::detail::create_emplace_args(std::forward(a0), - std::forward(a1), std::forward(a2))); - } - - // try_emplace(const_iterator hint, key const&, Args&&...) - - template - iterator try_emplace( - const_iterator hint, key_type const& k, BOOST_FWD_REF(A0) a0) - { - return table_.try_emplace_hint_unique(hint, k, - boost::unordered::detail::create_emplace_args( - std::forward(a0))); - } - - template - iterator try_emplace(const_iterator hint, key_type const& k, - BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1) - { - return table_.try_emplace_hint_unique(hint, k, - boost::unordered::detail::create_emplace_args( - std::forward(a0), std::forward(a1))); - } - - template - iterator try_emplace(const_iterator hint, key_type const& k, - BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2) - { - return table_.try_emplace_hint_unique(hint, k, - boost::unordered::detail::create_emplace_args(std::forward(a0), - std::forward(a1), std::forward(a2))); - } - - // try_emplace(const_iterator hint, key&&, Args&&...) - - template - iterator try_emplace( - const_iterator hint, BOOST_RV_REF(key_type) k, BOOST_FWD_REF(A0) a0) - { - return table_.try_emplace_hint_unique(hint, std::move(k), - boost::unordered::detail::create_emplace_args( - std::forward(a0))); - } - - template - iterator try_emplace(const_iterator hint, BOOST_RV_REF(key_type) k, - BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1) - { - return table_.try_emplace_hint_unique(hint, std::move(k), - boost::unordered::detail::create_emplace_args( - std::forward(a0), std::forward(a1))); - } - - template - iterator try_emplace(const_iterator hint, BOOST_RV_REF(key_type) k, - BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2) - { - return table_.try_emplace_hint_unique(hint, std::move(k), - boost::unordered::detail::create_emplace_args(std::forward(a0), - std::forward(a1), std::forward(a2))); - } - - // try_emplace(const_iterator hint, Key&&, Args&&...) - - template - typename boost::enable_if_c< - detail::transparent_non_iterable::value, - iterator>::type - try_emplace( - const_iterator hint, BOOST_FWD_REF(Key) k, BOOST_FWD_REF(A0) a0) - { - return table_.try_emplace_hint_unique(hint, std::forward(k), - boost::unordered::detail::create_emplace_args( - std::forward(a0))); - } - - template - typename boost::enable_if_c< - detail::transparent_non_iterable::value, - iterator>::type - try_emplace(const_iterator hint, BOOST_FWD_REF(Key) k, - BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1) - { - return table_.try_emplace_hint_unique(hint, std::forward(k), - boost::unordered::detail::create_emplace_args( - std::forward(a0), std::forward(a1))); - } - - template - typename boost::enable_if_c< - detail::transparent_non_iterable::value, - iterator>::type - try_emplace(const_iterator hint, BOOST_FWD_REF(Key) k, - BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2) - { - return table_.try_emplace_hint_unique(hint, std::forward(k), - boost::unordered::detail::create_emplace_args(std::forward(a0), - std::forward(a1), std::forward(a2))); - } - -#define BOOST_UNORDERED_TRY_EMPLACE(z, n, _) \ - \ - template \ - std::pair try_emplace( \ - key_type const& k, BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_FWD_PARAM, a)) \ - { \ - return table_.try_emplace_unique( \ - k, boost::unordered::detail::create_emplace_args( \ - BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_CALL_FORWARD, a))); \ - } \ - \ - template \ - std::pair try_emplace(BOOST_RV_REF(key_type) k, \ - BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_FWD_PARAM, a)) \ - { \ - return table_.try_emplace_unique( \ - std::move(k), boost::unordered::detail::create_emplace_args( \ - BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_CALL_FORWARD, a))); \ - } \ - \ - template \ - iterator try_emplace(const_iterator hint, key_type const& k, \ - BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_FWD_PARAM, a)) \ - { \ - return table_.try_emplace_hint_unique(hint, k, \ - boost::unordered::detail::create_emplace_args( \ - BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_CALL_FORWARD, a))); \ - } \ - \ - template \ - iterator try_emplace(const_iterator hint, BOOST_RV_REF(key_type) k, \ - BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_FWD_PARAM, a)) \ - { \ - return table_.try_emplace_hint_unique(hint, std::move(k), \ - boost::unordered::detail::create_emplace_args( \ - BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_CALL_FORWARD, a))); \ - } - - BOOST_UNORDERED_TRY_EMPLACE(1, 4, _) - BOOST_UNORDERED_TRY_EMPLACE(1, 5, _) - BOOST_UNORDERED_TRY_EMPLACE(1, 6, _) - BOOST_UNORDERED_TRY_EMPLACE(1, 7, _) - BOOST_UNORDERED_TRY_EMPLACE(1, 8, _) - BOOST_UNORDERED_TRY_EMPLACE(1, 9, _) - BOOST_PP_REPEAT_FROM_TO(10, BOOST_PP_INC(BOOST_UNORDERED_EMPLACE_LIMIT), - BOOST_UNORDERED_TRY_EMPLACE, _) - -#undef BOOST_UNORDERED_TRY_EMPLACE - -#endif - template std::pair insert_or_assign( key_type const& k, BOOST_FWD_REF(M) obj) @@ -826,8 +516,7 @@ namespace boost { const_iterator, BOOST_FWD_REF(Key) k, BOOST_FWD_REF(M) obj) { return table_ - .insert_or_assign_unique( - std::forward(k), std::forward(obj)) + .insert_or_assign_unique(std::forward(k), std::forward(obj)) .first; } @@ -1302,8 +991,6 @@ namespace boost { // emplace -#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) - template iterator emplace(BOOST_FWD_REF(Args)... args) { return iterator(table_.emplace_equiv( @@ -1311,57 +998,6 @@ namespace boost { table_.node_alloc(), std::forward(args)...))); } -#else - -#if !BOOST_UNORDERED_SUN_WORKAROUNDS1 - - // 0 argument emplace requires special treatment in case - // the container is instantiated with a value type that - // doesn't have a default constructor. - - iterator emplace(boost::unordered::detail::empty_emplace = - boost::unordered::detail::empty_emplace(), - value_type v = value_type()) - { - return this->emplace(std::move(v)); - } - -#endif - - template iterator emplace(BOOST_FWD_REF(A0) a0) - { - return iterator(table_.emplace_equiv( - boost::unordered::detail::func::construct_node_from_args( - table_.node_alloc(), boost::unordered::detail::create_emplace_args( - std::forward(a0))))); - } - - template - iterator emplace(BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1) - { - return iterator(table_.emplace_equiv( - boost::unordered::detail::func::construct_node_from_args( - table_.node_alloc(), - boost::unordered::detail::create_emplace_args( - std::forward(a0), std::forward(a1))))); - } - - template - iterator emplace( - BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2) - { - return iterator(table_.emplace_equiv( - boost::unordered::detail::func::construct_node_from_args( - table_.node_alloc(), - boost::unordered::detail::create_emplace_args( - std::forward(a0), std::forward(a1), - std::forward(a2))))); - } - -#endif - -#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) - template iterator emplace_hint(const_iterator hint, BOOST_FWD_REF(Args)... args) { @@ -1370,91 +1006,6 @@ namespace boost { table_.node_alloc(), std::forward(args)...))); } -#else - -#if !BOOST_UNORDERED_SUN_WORKAROUNDS1 - - iterator emplace_hint(const_iterator hint, - boost::unordered::detail::empty_emplace = - boost::unordered::detail::empty_emplace(), - value_type v = value_type()) - { - return this->emplace_hint(hint, std::move(v)); - } - -#endif - - template - iterator emplace_hint(const_iterator hint, BOOST_FWD_REF(A0) a0) - { - return iterator(table_.emplace_hint_equiv(hint, - boost::unordered::detail::func::construct_node_from_args( - table_.node_alloc(), boost::unordered::detail::create_emplace_args( - std::forward(a0))))); - } - - template - iterator emplace_hint( - const_iterator hint, BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1) - { - return iterator(table_.emplace_hint_equiv( - hint, boost::unordered::detail::func::construct_node_from_args( - table_.node_alloc(), - boost::unordered::detail::create_emplace_args( - std::forward(a0), std::forward(a1))))); - } - - template - iterator emplace_hint(const_iterator hint, BOOST_FWD_REF(A0) a0, - BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2) - { - return iterator(table_.emplace_hint_equiv( - hint, boost::unordered::detail::func::construct_node_from_args( - table_.node_alloc(), - boost::unordered::detail::create_emplace_args( - std::forward(a0), std::forward(a1), - std::forward(a2))))); - } - -#endif - -#if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) - -#define BOOST_UNORDERED_EMPLACE(z, n, _) \ - template \ - iterator emplace(BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_FWD_PARAM, a)) \ - { \ - return iterator(table_.emplace_equiv( \ - boost::unordered::detail::func::construct_node_from_args( \ - table_.node_alloc(), \ - boost::unordered::detail::create_emplace_args( \ - BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_CALL_FORWARD, a))))); \ - } \ - \ - template \ - iterator emplace_hint( \ - const_iterator hint, BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_FWD_PARAM, a)) \ - { \ - return iterator(table_.emplace_hint_equiv( \ - hint, boost::unordered::detail::func::construct_node_from_args( \ - table_.node_alloc(), \ - boost::unordered::detail::create_emplace_args( \ - BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_CALL_FORWARD, a))))); \ - } - - BOOST_UNORDERED_EMPLACE(1, 4, _) - BOOST_UNORDERED_EMPLACE(1, 5, _) - BOOST_UNORDERED_EMPLACE(1, 6, _) - BOOST_UNORDERED_EMPLACE(1, 7, _) - BOOST_UNORDERED_EMPLACE(1, 8, _) - BOOST_UNORDERED_EMPLACE(1, 9, _) - BOOST_PP_REPEAT_FROM_TO(10, BOOST_PP_INC(BOOST_UNORDERED_EMPLACE_LIMIT), - BOOST_UNORDERED_EMPLACE, _) - -#undef BOOST_UNORDERED_EMPLACE - -#endif - iterator insert(value_type const& x) { return this->emplace(x); } iterator insert(BOOST_RV_REF(value_type) x) @@ -1849,8 +1400,7 @@ namespace boost { select_on_container_copy_construction(other.get_allocator())) { if (other.size()) { - table_.copy_buckets( - other.table_, std::true_type()); + table_.copy_buckets(other.table_, std::true_type()); } } @@ -1867,8 +1417,7 @@ namespace boost { : table_(other.table_, a) { if (other.table_.size_) { - table_.copy_buckets( - other.table_, std::true_type()); + table_.copy_buckets(other.table_, std::true_type()); } } @@ -2382,8 +1931,7 @@ namespace boost { select_on_container_copy_construction(other.get_allocator())) { if (other.table_.size_) { - table_.copy_buckets( - other.table_, std::false_type()); + table_.copy_buckets(other.table_, std::false_type()); } } @@ -2401,8 +1949,7 @@ namespace boost { : table_(other.table_, a) { if (other.table_.size_) { - table_.copy_buckets( - other.table_, std::false_type()); + table_.copy_buckets(other.table_, std::false_type()); } } diff --git a/include/boost/unordered/unordered_set.hpp b/include/boost/unordered/unordered_set.hpp index 67d416ce..931e954e 100644 --- a/include/boost/unordered/unordered_set.hpp +++ b/include/boost/unordered/unordered_set.hpp @@ -251,8 +251,7 @@ namespace boost { { return table_.emplace_unique( table::extractor::extract(std::forward(a0)), - boost::unordered::detail::create_emplace_args( - std::forward(a0))); + boost::unordered::detail::create_emplace_args(std::forward(a0))); } template @@ -260,8 +259,7 @@ namespace boost { BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1) { return table_.emplace_unique( - table::extractor::extract( - std::forward(a0), std::forward(a1)), + table::extractor::extract(std::forward(a0), std::forward(a1)), boost::unordered::detail::create_emplace_args( std::forward(a0), std::forward(a1))); } @@ -271,16 +269,13 @@ namespace boost { BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2) { return table_.emplace_unique( - table::extractor::extract( - std::forward(a0), std::forward(a1)), - boost::unordered::detail::create_emplace_args(std::forward(a0), - std::forward(a1), std::forward(a2))); + table::extractor::extract(std::forward(a0), std::forward(a1)), + boost::unordered::detail::create_emplace_args( + std::forward(a0), std::forward(a1), std::forward(a2))); } #endif -#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) - template iterator emplace_hint(const_iterator hint, BOOST_FWD_REF(Args)... args) { @@ -289,91 +284,6 @@ namespace boost { std::forward(args)...); } -#else - -#if !BOOST_UNORDERED_SUN_WORKAROUNDS1 - - iterator emplace_hint(const_iterator hint, - boost::unordered::detail::empty_emplace = - boost::unordered::detail::empty_emplace(), - value_type v = value_type()) - { - return this->emplace_hint(hint, std::move(v)); - } - -#endif - - template - iterator emplace_hint(const_iterator hint, BOOST_FWD_REF(A0) a0) - { - return table_.emplace_hint_unique(hint, - table::extractor::extract(std::forward(a0)), - boost::unordered::detail::create_emplace_args( - std::forward(a0))); - } - - template - iterator emplace_hint( - const_iterator hint, BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1) - { - return table_.emplace_hint_unique(hint, - table::extractor::extract( - std::forward(a0), std::forward(a1)), - boost::unordered::detail::create_emplace_args( - std::forward(a0), std::forward(a1))); - } - - template - iterator emplace_hint(const_iterator hint, BOOST_FWD_REF(A0) a0, - BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2) - { - return table_.emplace_hint_unique(hint, - table::extractor::extract( - std::forward(a0), std::forward(a1)), - boost::unordered::detail::create_emplace_args(std::forward(a0), - std::forward(a1), std::forward(a2))); - } - -#endif - -#if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) - -#define BOOST_UNORDERED_EMPLACE(z, n, _) \ - template \ - std::pair emplace( \ - BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_FWD_PARAM, a)) \ - { \ - return table_.emplace_unique( \ - table::extractor::extract( \ - std::forward(a0), std::forward(a1)), \ - boost::unordered::detail::create_emplace_args( \ - BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_CALL_FORWARD, a))); \ - } \ - \ - template \ - iterator emplace_hint( \ - const_iterator hint, BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_FWD_PARAM, a)) \ - { \ - return table_.emplace_hint_unique(hint, \ - table::extractor::extract( \ - std::forward(a0), std::forward(a1)), \ - boost::unordered::detail::create_emplace_args( \ - BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_CALL_FORWARD, a))); \ - } - - BOOST_UNORDERED_EMPLACE(1, 4, _) - BOOST_UNORDERED_EMPLACE(1, 5, _) - BOOST_UNORDERED_EMPLACE(1, 6, _) - BOOST_UNORDERED_EMPLACE(1, 7, _) - BOOST_UNORDERED_EMPLACE(1, 8, _) - BOOST_UNORDERED_EMPLACE(1, 9, _) - BOOST_PP_REPEAT_FROM_TO(10, BOOST_PP_INC(BOOST_UNORDERED_EMPLACE_LIMIT), - BOOST_UNORDERED_EMPLACE, _) - -#undef BOOST_UNORDERED_EMPLACE - -#endif - std::pair insert(value_type const& x) { return this->emplace(x); @@ -924,15 +834,12 @@ namespace boost { return iterator(table_.emplace_equiv( boost::unordered::detail::func::construct_node_from_args( table_.node_alloc(), - boost::unordered::detail::create_emplace_args( - std::forward(a0), std::forward(a1), - std::forward(a2))))); + boost::unordered::detail::create_emplace_args(std::forward(a0), + std::forward(a1), std::forward(a2))))); } #endif -#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) - template iterator emplace_hint(const_iterator hint, BOOST_FWD_REF(Args)... args) { @@ -941,91 +848,6 @@ namespace boost { table_.node_alloc(), std::forward(args)...))); } -#else - -#if !BOOST_UNORDERED_SUN_WORKAROUNDS1 - - iterator emplace_hint(const_iterator hint, - boost::unordered::detail::empty_emplace = - boost::unordered::detail::empty_emplace(), - value_type v = value_type()) - { - return this->emplace_hint(hint, std::move(v)); - } - -#endif - - template - iterator emplace_hint(const_iterator hint, BOOST_FWD_REF(A0) a0) - { - return iterator(table_.emplace_hint_equiv(hint, - boost::unordered::detail::func::construct_node_from_args( - table_.node_alloc(), boost::unordered::detail::create_emplace_args( - std::forward(a0))))); - } - - template - iterator emplace_hint( - const_iterator hint, BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1) - { - return iterator(table_.emplace_hint_equiv( - hint, boost::unordered::detail::func::construct_node_from_args( - table_.node_alloc(), - boost::unordered::detail::create_emplace_args( - std::forward(a0), std::forward(a1))))); - } - - template - iterator emplace_hint(const_iterator hint, BOOST_FWD_REF(A0) a0, - BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2) - { - return iterator(table_.emplace_hint_equiv( - hint, boost::unordered::detail::func::construct_node_from_args( - table_.node_alloc(), - boost::unordered::detail::create_emplace_args( - std::forward(a0), std::forward(a1), - std::forward(a2))))); - } - -#endif - -#if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) - -#define BOOST_UNORDERED_EMPLACE(z, n, _) \ - template \ - iterator emplace(BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_FWD_PARAM, a)) \ - { \ - return iterator(table_.emplace_equiv( \ - boost::unordered::detail::func::construct_node_from_args( \ - table_.node_alloc(), \ - boost::unordered::detail::create_emplace_args( \ - BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_CALL_FORWARD, a))))); \ - } \ - \ - template \ - iterator emplace_hint( \ - const_iterator hint, BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_FWD_PARAM, a)) \ - { \ - return iterator(table_.emplace_hint_equiv( \ - hint, boost::unordered::detail::func::construct_node_from_args( \ - table_.node_alloc(), \ - boost::unordered::detail::create_emplace_args( \ - BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_CALL_FORWARD, a))))); \ - } - - BOOST_UNORDERED_EMPLACE(1, 4, _) - BOOST_UNORDERED_EMPLACE(1, 5, _) - BOOST_UNORDERED_EMPLACE(1, 6, _) - BOOST_UNORDERED_EMPLACE(1, 7, _) - BOOST_UNORDERED_EMPLACE(1, 8, _) - BOOST_UNORDERED_EMPLACE(1, 9, _) - BOOST_PP_REPEAT_FROM_TO(10, BOOST_PP_INC(BOOST_UNORDERED_EMPLACE_LIMIT), - BOOST_UNORDERED_EMPLACE, _) - -#undef BOOST_UNORDERED_EMPLACE - -#endif - iterator insert(value_type const& x) { return this->emplace(x); } iterator insert(BOOST_UNORDERED_RV_REF(value_type) x) diff --git a/test/helpers/test.hpp b/test/helpers/test.hpp index 9f915f5a..feee7cc9 100644 --- a/test/helpers/test.hpp +++ b/test/helpers/test.hpp @@ -134,8 +134,6 @@ namespace test { << "Compiler: " << BOOST_COMPILER << "\n" \ << "Library: " << BOOST_STDLIB << "\n" \ << "__cplusplus: " << BOOST_UNORDERED_CPLUSPLUS << "\n\n" \ - << "BOOST_UNORDERED_EMPLACE_LIMIT: " << BOOST_UNORDERED_EMPLACE_LIMIT \ - << "\n" \ << std::flush; \ }