diff --git a/include/boost/unordered/unordered_map.hpp b/include/boost/unordered/unordered_map.hpp index 8710b3b7..7408f0e9 100644 --- a/include/boost/unordered/unordered_map.hpp +++ b/include/boost/unordered/unordered_map.hpp @@ -24,9 +24,7 @@ #include #include -#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) #include -#endif #if defined(BOOST_MSVC) #pragma warning(push) @@ -115,12 +113,10 @@ namespace boost { unordered_map(BOOST_RV_REF(unordered_map), allocator_type const&); -#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) unordered_map(std::initializer_list, size_type = boost::unordered::detail::default_bucket_count, const hasher& = hasher(), const key_equal& l = key_equal(), const allocator_type& = allocator_type()); -#endif explicit unordered_map(size_type, const allocator_type&); @@ -136,7 +132,6 @@ namespace boost { unordered_map( InputIt, InputIt, size_type, const hasher&, const allocator_type&); -#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) unordered_map(std::initializer_list, const allocator_type&); unordered_map( @@ -144,7 +139,6 @@ namespace boost { unordered_map(std::initializer_list, size_type, const hasher&, const allocator_type&); -#endif // Destructor @@ -186,9 +180,7 @@ namespace boost { #endif #endif -#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) unordered_map& operator=(std::initializer_list); -#endif allocator_type get_allocator() const noexcept { @@ -423,9 +415,7 @@ namespace boost { template void insert(InputIt, InputIt); -#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) void insert(std::initializer_list); -#endif // extract @@ -584,7 +574,7 @@ namespace boost { { return table_.try_emplace_unique( std::move(k), boost::unordered::detail::create_emplace_args( - boost::forward(a0))); + boost::forward(a0))); } template @@ -593,7 +583,7 @@ namespace boost { { return table_.try_emplace_unique( std::move(k), boost::unordered::detail::create_emplace_args( - boost::forward(a0), boost::forward(a1))); + boost::forward(a0), boost::forward(a1))); } template @@ -753,9 +743,9 @@ namespace boost { 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))); \ + 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 \ @@ -771,7 +761,7 @@ namespace boost { 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), \ + 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))); \ } @@ -1222,12 +1212,10 @@ namespace boost { unordered_multimap( BOOST_RV_REF(unordered_multimap), allocator_type const&); -#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) unordered_multimap(std::initializer_list, size_type = boost::unordered::detail::default_bucket_count, const hasher& = hasher(), const key_equal& l = key_equal(), const allocator_type& = allocator_type()); -#endif explicit unordered_multimap(size_type, const allocator_type&); @@ -1244,7 +1232,6 @@ namespace boost { unordered_multimap( InputIt, InputIt, size_type, const hasher&, const allocator_type&); -#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) unordered_multimap( std::initializer_list, const allocator_type&); @@ -1253,7 +1240,6 @@ namespace boost { unordered_multimap(std::initializer_list, size_type, const hasher&, const allocator_type&); -#endif // Destructor @@ -1295,9 +1281,7 @@ namespace boost { #endif #endif -#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) unordered_multimap& operator=(std::initializer_list); -#endif allocator_type get_allocator() const noexcept { @@ -1525,9 +1509,7 @@ namespace boost { template void insert(InputIt, InputIt); -#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) void insert(std::initializer_list); -#endif // extract @@ -1917,8 +1899,6 @@ namespace boost { table_.move_construct_buckets(other.table_); } -#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) - template unordered_map::unordered_map( std::initializer_list list, size_type n, const hasher& hf, @@ -1930,8 +1910,6 @@ namespace boost { this->insert(list.begin(), list.end()); } -#endif - template unordered_map::unordered_map( size_type n, const allocator_type& a) @@ -1977,8 +1955,6 @@ namespace boost { this->insert(f, l); } -#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) - template unordered_map::unordered_map( std::initializer_list list, const allocator_type& a) @@ -2011,15 +1987,11 @@ namespace boost { this->insert(list.begin(), list.end()); } -#endif - template unordered_map::~unordered_map() noexcept { } -#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) - template unordered_map& unordered_map::operator=( std::initializer_list list) @@ -2029,8 +2001,6 @@ namespace boost { return *this; } -#endif - // size and capacity template @@ -2057,14 +2027,12 @@ namespace boost { } } -#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) template void unordered_map::insert( std::initializer_list list) { this->insert(list.begin(), list.end()); } -#endif template typename unordered_map::iterator @@ -2465,8 +2433,6 @@ namespace boost { table_.move_construct_buckets(other.table_); } -#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) - template unordered_multimap::unordered_multimap( std::initializer_list list, size_type n, const hasher& hf, @@ -2478,8 +2444,6 @@ namespace boost { this->insert(list.begin(), list.end()); } -#endif - template unordered_multimap::unordered_multimap( size_type n, const allocator_type& a) @@ -2525,8 +2489,6 @@ namespace boost { this->insert(f, l); } -#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) - template unordered_multimap::unordered_multimap( std::initializer_list list, const allocator_type& a) @@ -2559,15 +2521,11 @@ namespace boost { this->insert(list.begin(), list.end()); } -#endif - template unordered_multimap::~unordered_multimap() noexcept { } -#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) - template unordered_multimap& unordered_multimap::operator=( @@ -2578,8 +2536,6 @@ namespace boost { return *this; } -#endif - // size and capacity template @@ -2603,14 +2559,12 @@ namespace boost { table_.insert_range_equiv(first, last); } -#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) template void unordered_multimap::insert( std::initializer_list list) { this->insert(list.begin(), list.end()); } -#endif template typename unordered_multimap::iterator diff --git a/include/boost/unordered/unordered_set.hpp b/include/boost/unordered/unordered_set.hpp index a5f90625..fe71383e 100644 --- a/include/boost/unordered/unordered_set.hpp +++ b/include/boost/unordered/unordered_set.hpp @@ -23,9 +23,7 @@ #include #include -#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) #include -#endif #if defined(BOOST_MSVC) #pragma warning(push) @@ -113,12 +111,10 @@ namespace boost { unordered_set(BOOST_RV_REF(unordered_set), allocator_type const&); -#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) unordered_set(std::initializer_list, size_type = boost::unordered::detail::default_bucket_count, const hasher& = hasher(), const key_equal& l = key_equal(), const allocator_type& = allocator_type()); -#endif explicit unordered_set(size_type, const allocator_type&); @@ -134,7 +130,6 @@ namespace boost { unordered_set( InputIt, InputIt, size_type, const hasher&, const allocator_type&); -#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) unordered_set(std::initializer_list, const allocator_type&); unordered_set( @@ -142,7 +137,6 @@ namespace boost { unordered_set(std::initializer_list, size_type, const hasher&, const allocator_type&); -#endif // Destructor @@ -184,9 +178,7 @@ namespace boost { #endif #endif -#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) unordered_set& operator=(std::initializer_list); -#endif allocator_type get_allocator() const noexcept { @@ -422,9 +414,7 @@ namespace boost { template void insert(InputIt, InputIt); -#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) void insert(std::initializer_list); -#endif // extract @@ -794,12 +784,10 @@ namespace boost { unordered_multiset( BOOST_RV_REF(unordered_multiset), allocator_type const&); -#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) unordered_multiset(std::initializer_list, size_type = boost::unordered::detail::default_bucket_count, const hasher& = hasher(), const key_equal& l = key_equal(), const allocator_type& = allocator_type()); -#endif explicit unordered_multiset(size_type, const allocator_type&); @@ -816,7 +804,6 @@ namespace boost { unordered_multiset( InputIt, InputIt, size_type, const hasher&, const allocator_type&); -#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) unordered_multiset( std::initializer_list, const allocator_type&); @@ -825,7 +812,6 @@ namespace boost { unordered_multiset(std::initializer_list, size_type, const hasher&, const allocator_type&); -#endif // Destructor @@ -867,9 +853,7 @@ namespace boost { #endif #endif -#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) unordered_multiset& operator=(std::initializer_list); -#endif allocator_type get_allocator() const noexcept { @@ -1081,9 +1065,7 @@ namespace boost { template void insert(InputIt, InputIt); -#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) void insert(std::initializer_list); -#endif // extract @@ -1438,8 +1420,6 @@ namespace boost { table_.move_construct_buckets(other.table_); } -#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) - template unordered_set::unordered_set( std::initializer_list list, size_type n, const hasher& hf, @@ -1451,8 +1431,6 @@ namespace boost { this->insert(list.begin(), list.end()); } -#endif - template unordered_set::unordered_set( size_type n, const allocator_type& a) @@ -1498,8 +1476,6 @@ namespace boost { this->insert(f, l); } -#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) - template unordered_set::unordered_set( std::initializer_list list, const allocator_type& a) @@ -1532,15 +1508,11 @@ namespace boost { this->insert(list.begin(), list.end()); } -#endif - template unordered_set::~unordered_set() noexcept { } -#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) - template unordered_set& unordered_set::operator=( std::initializer_list list) @@ -1550,8 +1522,6 @@ namespace boost { return *this; } -#endif - // size and capacity template @@ -1578,14 +1548,12 @@ namespace boost { } } -#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) template void unordered_set::insert( std::initializer_list list) { this->insert(list.begin(), list.end()); } -#endif template typename unordered_set::iterator @@ -1856,8 +1824,6 @@ namespace boost { table_.move_construct_buckets(other.table_); } -#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) - template unordered_multiset::unordered_multiset( std::initializer_list list, size_type n, const hasher& hf, @@ -1869,8 +1835,6 @@ namespace boost { this->insert(list.begin(), list.end()); } -#endif - template unordered_multiset::unordered_multiset( size_type n, const allocator_type& a) @@ -1916,8 +1880,6 @@ namespace boost { this->insert(f, l); } -#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) - template unordered_multiset::unordered_multiset( std::initializer_list list, const allocator_type& a) @@ -1950,15 +1912,11 @@ namespace boost { this->insert(list.begin(), list.end()); } -#endif - template unordered_multiset::~unordered_multiset() noexcept { } -#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) - template unordered_multiset& unordered_multiset::operator=( std::initializer_list list) @@ -1968,8 +1926,6 @@ namespace boost { return *this; } -#endif - // size and capacity template @@ -1993,14 +1949,12 @@ namespace boost { table_.insert_range_equiv(first, last); } -#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) template void unordered_multiset::insert( std::initializer_list list) { this->insert(list.begin(), list.end()); } -#endif template typename unordered_multiset::iterator diff --git a/test/unordered/assign_tests.cpp b/test/unordered/assign_tests.cpp index e75f734d..21f43a53 100644 --- a/test/unordered/assign_tests.cpp +++ b/test/unordered/assign_tests.cpp @@ -436,8 +436,6 @@ namespace assign_tests { (default_generator)(generate_collisions)(limited_range))) #endif -#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) - UNORDERED_AUTO_TEST (assign_default_initializer_list) { BOOST_LIGHTWEIGHT_TEST_OSTREAM << "Initializer List Tests\n"; std::initializer_list > init; @@ -459,9 +457,6 @@ namespace assign_tests { BOOST_TEST(x1.empty()); } -#endif - -#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) UNORDERED_AUTO_TEST (assign_initializer_list) { BOOST_LIGHTWEIGHT_TEST_OSTREAM << "Initializer List Tests\n"; @@ -482,8 +477,6 @@ namespace assign_tests { BOOST_TEST(x.find(10) == x.end()); BOOST_TEST(x.find(-10) != x.end()); } - -#endif } RUN_TESTS() diff --git a/test/unordered/compile_tests.hpp b/test/unordered/compile_tests.hpp index fd5479df..0f8ca6b8 100644 --- a/test/unordered/compile_tests.hpp +++ b/test/unordered/compile_tests.hpp @@ -34,16 +34,7 @@ template void sink(T const&) {} template T rvalue(T const& v) { return v; } template T rvalue_default() { return T(); } -#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) template T implicit_construct() { return {}; } -#else -template int implicit_construct() -{ - T x; - sink(x); - return 0; -} -#endif #if !defined(BOOST_NO_CXX11_NOEXCEPT) #define TEST_NOEXCEPT_EXPR(x) BOOST_STATIC_ASSERT((noexcept(x))); @@ -143,13 +134,11 @@ template void container_test(X& r, T const&) // I don't test the runtime post-conditions here. -#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) // It isn't specified in the container requirements that the no argument // constructor is implicit, but it is defined that way in the concrete // container specification. X u_implicit = {}; sink(u_implicit); -#endif X u; BOOST_TEST(u.size() == 0); @@ -793,7 +782,6 @@ void unordered_copyable_test(X& x, Key& k, T& t, Hash& hf, Pred& eq) // X a8a(i, j, m); // sink(a8a); -#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) std::size_t min_buckets = 10; X({t}); X({t}, min_buckets); @@ -803,7 +791,6 @@ void unordered_copyable_test(X& x, Key& k, T& t, Hash& hf, Pred& eq) X({t}, min_buckets, m); X({t}, min_buckets, hf, m); X({t}, min_buckets, hf, eq, m); -#endif X const b; sink(X(b)); @@ -826,7 +813,6 @@ void unordered_copyable_test(X& x, Key& k, T& t, Hash& hf, Pred& eq) test::check_return_type::equals(a.emplace_hint(q, t)); a.insert(i, j); -#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) std::initializer_list list = {t}; a.insert(list); a.insert({t, t, t}); @@ -837,7 +823,6 @@ void unordered_copyable_test(X& x, Key& k, T& t, Hash& hf, Pred& eq) a.insert({}); a.insert({t}); a.insert({t, t}); -#endif #endif X a10; diff --git a/test/unordered/constructor_tests.cpp b/test/unordered/constructor_tests.cpp index 54268a42..7eaa99bc 100644 --- a/test/unordered/constructor_tests.cpp +++ b/test/unordered/constructor_tests.cpp @@ -324,7 +324,6 @@ namespace constructor_tests { test::check_equivalent_keys(x); } -#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) typedef typename T::value_type value_type; std::initializer_list list; @@ -525,7 +524,6 @@ namespace constructor_tests { test::check_container(x, expected); } } -#endif } template @@ -608,7 +606,6 @@ namespace constructor_tests { BOOST_TEST_EQ(test::detail::tracker.count_allocations, 0u); } -#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) UNORDERED_SUB_TEST("Initializer list 1") { std::initializer_list list; @@ -633,7 +630,6 @@ namespace constructor_tests { BOOST_TEST_GT(test::detail::tracker.count_allocations, 0u); } } -#endif } template @@ -721,8 +717,6 @@ namespace constructor_tests { (default_generator)(generate_collisions)(limited_range))) #endif -#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) - UNORDERED_AUTO_TEST (test_default_initializer_list) { std::initializer_list init; #ifdef BOOST_UNORDERED_FOA_TESTS @@ -735,10 +729,6 @@ namespace constructor_tests { BOOST_TEST(x1.empty()); } -#endif - -#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) - UNORDERED_AUTO_TEST (test_initializer_list) { #ifdef BOOST_UNORDERED_FOA_TESTS boost::unordered_flat_set x1 = {2, 10, 45, -5}; @@ -752,8 +742,6 @@ namespace constructor_tests { BOOST_TEST(x1.find(10) != x1.end()); BOOST_TEST(x1.find(46) == x1.end()); } - -#endif } // namespace constructor_tests RUN_TESTS_QUIET() diff --git a/test/unordered/insert_tests.cpp b/test/unordered/insert_tests.cpp index 42a54e28..db8b9020 100644 --- a/test/unordered/insert_tests.cpp +++ b/test/unordered/insert_tests.cpp @@ -1079,8 +1079,6 @@ namespace insert_tests { UNORDERED_TEST(set_tests2, ((test_pc_set))) #endif -#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) - struct initialize_from_two_ints { int a, b; @@ -1201,8 +1199,6 @@ namespace insert_tests { BOOST_TEST_EQ(multimap.size(), 3u); BOOST_TEST_EQ(multimap.count("a"), 2u); } -#endif - #endif struct overloaded_constructor