From af94e6a40eb96eb88259cc5fa0e832fc720af532 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Thu, 20 Apr 2017 22:59:00 +0100 Subject: [PATCH] Reorder the constructors to match the draft standard In order to make it easier to check against the standard. This includes collapsing some of the input iterator overloads into one constructor. --- include/boost/unordered/unordered_map.hpp | 376 ++++++++++------------ include/boost/unordered/unordered_set.hpp | 375 ++++++++++----------- 2 files changed, 351 insertions(+), 400 deletions(-) diff --git a/include/boost/unordered/unordered_map.hpp b/include/boost/unordered/unordered_map.hpp index 75e8a02a..8da55311 100644 --- a/include/boost/unordered/unordered_map.hpp +++ b/include/boost/unordered/unordered_map.hpp @@ -85,36 +85,14 @@ template class unordered_map const key_equal& = key_equal(), const allocator_type& = allocator_type()); - explicit unordered_map(size_type, const allocator_type&); - - explicit unordered_map(size_type, const hasher&, const allocator_type&); - - explicit unordered_map(allocator_type const&); - - template unordered_map(InputIt, InputIt); - template - unordered_map(InputIt, InputIt, size_type, const hasher& = hasher(), - const key_equal& = key_equal()); - - template - unordered_map(InputIt, InputIt, size_type, const hasher&, const key_equal&, - const allocator_type&); - - template - unordered_map( - InputIt, InputIt, size_type, const hasher&, const allocator_type&); - - template - unordered_map(InputIt, InputIt, size_type, const allocator_type&); - - // copy/move constructors + unordered_map(InputIt, InputIt, + size_type = boost::unordered::detail::default_bucket_count, + const hasher& = hasher(), const key_equal& = key_equal(), + const allocator_type& = allocator_type()); unordered_map(unordered_map const&); - unordered_map(unordered_map const&, allocator_type const&); - unordered_map(BOOST_RV_REF(unordered_map), allocator_type const&); - #if defined(BOOST_UNORDERED_USE_MOVE) unordered_map(BOOST_RV_REF(unordered_map) other) BOOST_NOEXCEPT_IF(table::nothrow_move_constructible) @@ -129,15 +107,36 @@ template class unordered_map } #endif + explicit unordered_map(allocator_type const&); + + unordered_map(unordered_map const&, allocator_type const&); + + 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()); - unordered_map(std::initializer_list, size_type, const hasher&, - const allocator_type&); +#endif + + explicit unordered_map(size_type, const allocator_type&); + + explicit unordered_map(size_type, const hasher&, const allocator_type&); + + template + unordered_map(InputIt, InputIt, size_type, const allocator_type&); + + template + unordered_map( + InputIt, InputIt, size_type, const hasher&, const allocator_type&); + +#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) unordered_map( std::initializer_list, size_type, const allocator_type&); + + unordered_map(std::initializer_list, size_type, const hasher&, + const allocator_type&); #endif // Destructor @@ -800,37 +799,14 @@ template class unordered_multimap const key_equal& = key_equal(), const allocator_type& = allocator_type()); - explicit unordered_multimap(size_type, const allocator_type&); - - explicit unordered_multimap( - size_type, const hasher&, const allocator_type&); - - explicit unordered_multimap(allocator_type const&); - - template unordered_multimap(InputIt, InputIt); - template - unordered_multimap(InputIt, InputIt, size_type, const hasher& = hasher(), - const key_equal& = key_equal()); - - template - unordered_multimap(InputIt, InputIt, size_type, const hasher&, - const key_equal&, const allocator_type&); - - template - unordered_multimap( - InputIt, InputIt, size_type, const hasher&, const allocator_type&); - - template - unordered_multimap(InputIt, InputIt, size_type, const allocator_type&); - - // copy/move constructors + unordered_multimap(InputIt, InputIt, + size_type = boost::unordered::detail::default_bucket_count, + const hasher& = hasher(), const key_equal& = key_equal(), + const allocator_type& = allocator_type()); unordered_multimap(unordered_multimap const&); - unordered_multimap(unordered_multimap const&, allocator_type const&); - unordered_multimap(BOOST_RV_REF(unordered_multimap), allocator_type const&); - #if defined(BOOST_UNORDERED_USE_MOVE) unordered_multimap(BOOST_RV_REF(unordered_multimap) other) BOOST_NOEXCEPT_IF(table::nothrow_move_constructible) @@ -845,15 +821,37 @@ template class unordered_multimap } #endif + explicit unordered_multimap(allocator_type const&); + + unordered_multimap(unordered_multimap const&, allocator_type const&); + + 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()); - unordered_multimap(std::initializer_list, size_type, - const hasher&, const allocator_type&); +#endif + + explicit unordered_multimap(size_type, const allocator_type&); + + explicit unordered_multimap( + size_type, const hasher&, const allocator_type&); + + template + unordered_multimap(InputIt, InputIt, size_type, const allocator_type&); + + template + unordered_multimap( + InputIt, InputIt, size_type, const hasher&, const allocator_type&); + +#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) unordered_multimap( std::initializer_list, size_type, const allocator_type&); + + unordered_multimap(std::initializer_list, size_type, + const hasher&, const allocator_type&); #endif // Destructor @@ -1243,16 +1241,17 @@ unordered_map::unordered_map(size_type n, const hasher& hf, } template -unordered_map::unordered_map( - size_type n, const allocator_type& a) - : table_(n, hasher(), key_equal(), a) +template +unordered_map::unordered_map(InputIt f, InputIt l, size_type n, + const hasher& hf, const key_equal& eql, const allocator_type& a) + : table_(boost::unordered::detail::initial_size(f, l, n), hf, eql, a) { + table_.insert_range(f, l); } template -unordered_map::unordered_map( - size_type n, const hasher& hf, const allocator_type& a) - : table_(n, hf, key_equal(), a) +unordered_map::unordered_map(unordered_map const& other) + : table_(other.table_) { } @@ -1270,65 +1269,6 @@ unordered_map::unordered_map( { } -template -template -unordered_map::unordered_map(InputIt f, InputIt l) - : table_(boost::unordered::detail::initial_size(f, l), hasher(), - key_equal(), allocator_type()) -{ - table_.insert_range(f, l); -} - -template -template -unordered_map::unordered_map( - InputIt f, InputIt l, size_type n, const hasher& hf, const key_equal& eql) - : table_(boost::unordered::detail::initial_size(f, l, n), hf, eql, - allocator_type()) -{ - table_.insert_range(f, l); -} - -template -template -unordered_map::unordered_map(InputIt f, InputIt l, size_type n, - const hasher& hf, const key_equal& eql, const allocator_type& a) - : table_(boost::unordered::detail::initial_size(f, l, n), hf, eql, a) -{ - table_.insert_range(f, l); -} - -template -template -unordered_map::unordered_map(InputIt f, InputIt l, size_type n, - const hasher& hf, const allocator_type& a) - : table_( - boost::unordered::detail::initial_size(f, l, n), hf, key_equal(), a) -{ - table_.insert_range(f, l); -} - -template -template -unordered_map::unordered_map( - InputIt f, InputIt l, size_type n, const allocator_type& a) - : table_(boost::unordered::detail::initial_size(f, l, n), hasher(), - key_equal(), a) -{ - table_.insert_range(f, l); -} - -template -unordered_map::~unordered_map() BOOST_NOEXCEPT -{ -} - -template -unordered_map::unordered_map(unordered_map const& other) - : table_(other.table_) -{ -} - template unordered_map::unordered_map( BOOST_RV_REF(unordered_map) other, allocator_type const& a) @@ -1349,17 +1289,44 @@ unordered_map::unordered_map( table_.insert_range(list.begin(), list.end()); } +#endif + template unordered_map::unordered_map( - std::initializer_list list, size_type n, const hasher& hf, - const allocator_type& a) - : table_( - boost::unordered::detail::initial_size(list.begin(), list.end(), n), - hf, key_equal(), a) + size_type n, const allocator_type& a) + : table_(n, hasher(), key_equal(), a) { - table_.insert_range(list.begin(), list.end()); } +template +unordered_map::unordered_map( + size_type n, const hasher& hf, const allocator_type& a) + : table_(n, hf, key_equal(), a) +{ +} + +template +template +unordered_map::unordered_map( + InputIt f, InputIt l, size_type n, const allocator_type& a) + : table_(boost::unordered::detail::initial_size(f, l, n), hasher(), + key_equal(), a) +{ + table_.insert_range(f, l); +} + +template +template +unordered_map::unordered_map(InputIt f, InputIt l, size_type n, + const hasher& hf, const allocator_type& a) + : table_( + boost::unordered::detail::initial_size(f, l, n), hf, key_equal(), a) +{ + table_.insert_range(f, l); +} + +#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) + template unordered_map::unordered_map( std::initializer_list list, size_type n, @@ -1371,6 +1338,26 @@ unordered_map::unordered_map( table_.insert_range(list.begin(), list.end()); } +template +unordered_map::unordered_map( + std::initializer_list list, size_type n, const hasher& hf, + const allocator_type& a) + : table_( + boost::unordered::detail::initial_size(list.begin(), list.end(), n), + hf, key_equal(), a) +{ + table_.insert_range(list.begin(), list.end()); +} + +#endif + +template +unordered_map::~unordered_map() BOOST_NOEXCEPT +{ +} + +#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) + template unordered_map& unordered_map::operator=( std::initializer_list list) @@ -1663,16 +1650,19 @@ unordered_multimap::unordered_multimap(size_type n, } template -unordered_multimap::unordered_multimap( - size_type n, const allocator_type& a) - : table_(n, hasher(), key_equal(), a) +template +unordered_multimap::unordered_multimap(InputIt f, InputIt l, + size_type n, const hasher& hf, const key_equal& eql, + const allocator_type& a) + : table_(boost::unordered::detail::initial_size(f, l, n), hf, eql, a) { + table_.insert_range(f, l); } template unordered_multimap::unordered_multimap( - size_type n, const hasher& hf, const allocator_type& a) - : table_(n, hf, key_equal(), a) + unordered_multimap const& other) + : table_(other.table_) { } @@ -1690,67 +1680,6 @@ unordered_multimap::unordered_multimap( { } -template -template -unordered_multimap::unordered_multimap(InputIt f, InputIt l) - : table_(boost::unordered::detail::initial_size(f, l), hasher(), - key_equal(), allocator_type()) -{ - table_.insert_range(f, l); -} - -template -template -unordered_multimap::unordered_multimap( - InputIt f, InputIt l, size_type n, const hasher& hf, const key_equal& eql) - : table_(boost::unordered::detail::initial_size(f, l, n), hf, eql, - allocator_type()) -{ - table_.insert_range(f, l); -} - -template -template -unordered_multimap::unordered_multimap(InputIt f, InputIt l, - size_type n, const hasher& hf, const key_equal& eql, - const allocator_type& a) - : table_(boost::unordered::detail::initial_size(f, l, n), hf, eql, a) -{ - table_.insert_range(f, l); -} - -template -template -unordered_multimap::unordered_multimap(InputIt f, InputIt l, - size_type n, const hasher& hf, const allocator_type& a) - : table_( - boost::unordered::detail::initial_size(f, l, n), hf, key_equal(), a) -{ - table_.insert_range(f, l); -} - -template -template -unordered_multimap::unordered_multimap( - InputIt f, InputIt l, size_type n, const allocator_type& a) - : table_(boost::unordered::detail::initial_size(f, l, n), hasher(), - key_equal(), a) -{ - table_.insert_range(f, l); -} - -template -unordered_multimap::~unordered_multimap() BOOST_NOEXCEPT -{ -} - -template -unordered_multimap::unordered_multimap( - unordered_multimap const& other) - : table_(other.table_) -{ -} - template unordered_multimap::unordered_multimap( BOOST_RV_REF(unordered_multimap) other, allocator_type const& a) @@ -1771,17 +1700,44 @@ unordered_multimap::unordered_multimap( table_.insert_range(list.begin(), list.end()); } +#endif + template unordered_multimap::unordered_multimap( - std::initializer_list list, size_type n, const hasher& hf, - const allocator_type& a) - : table_( - boost::unordered::detail::initial_size(list.begin(), list.end(), n), - hf, key_equal(), a) + size_type n, const allocator_type& a) + : table_(n, hasher(), key_equal(), a) { - table_.insert_range(list.begin(), list.end()); } +template +unordered_multimap::unordered_multimap( + size_type n, const hasher& hf, const allocator_type& a) + : table_(n, hf, key_equal(), a) +{ +} + +template +template +unordered_multimap::unordered_multimap( + InputIt f, InputIt l, size_type n, const allocator_type& a) + : table_(boost::unordered::detail::initial_size(f, l, n), hasher(), + key_equal(), a) +{ + table_.insert_range(f, l); +} + +template +template +unordered_multimap::unordered_multimap(InputIt f, InputIt l, + size_type n, const hasher& hf, const allocator_type& a) + : table_( + boost::unordered::detail::initial_size(f, l, n), hf, key_equal(), a) +{ + table_.insert_range(f, l); +} + +#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) + template unordered_multimap::unordered_multimap( std::initializer_list list, size_type n, @@ -1793,6 +1749,26 @@ unordered_multimap::unordered_multimap( table_.insert_range(list.begin(), list.end()); } +template +unordered_multimap::unordered_multimap( + std::initializer_list list, size_type n, const hasher& hf, + const allocator_type& a) + : table_( + boost::unordered::detail::initial_size(list.begin(), list.end(), n), + hf, key_equal(), a) +{ + table_.insert_range(list.begin(), list.end()); +} + +#endif + +template +unordered_multimap::~unordered_multimap() BOOST_NOEXCEPT +{ +} + +#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) + template unordered_multimap& unordered_multimap::operator=( std::initializer_list list) diff --git a/include/boost/unordered/unordered_set.hpp b/include/boost/unordered/unordered_set.hpp index afb25916..52e357f1 100644 --- a/include/boost/unordered/unordered_set.hpp +++ b/include/boost/unordered/unordered_set.hpp @@ -83,36 +83,14 @@ template class unordered_set const key_equal& = key_equal(), const allocator_type& = allocator_type()); - explicit unordered_set(size_type, const allocator_type&); - - explicit unordered_set(size_type, const hasher&, const allocator_type&); - - explicit unordered_set(allocator_type const&); - - template unordered_set(InputIt, InputIt); - template - unordered_set(InputIt, InputIt, size_type, const hasher& = hasher(), - const key_equal& = key_equal()); - - template - unordered_set(InputIt, InputIt, size_type, const hasher&, const key_equal&, - const allocator_type&); - - template - unordered_set( - InputIt, InputIt, size_type, const hasher&, const allocator_type&); - - template - unordered_set(InputIt, InputIt, size_type, const allocator_type&); - - // copy/move constructors + unordered_set(InputIt, InputIt, + size_type = boost::unordered::detail::default_bucket_count, + const hasher& = hasher(), const key_equal& = key_equal(), + const allocator_type& = allocator_type()); unordered_set(unordered_set const&); - unordered_set(unordered_set const&, allocator_type const&); - unordered_set(BOOST_RV_REF(unordered_set), allocator_type const&); - #if defined(BOOST_UNORDERED_USE_MOVE) unordered_set(BOOST_RV_REF(unordered_set) other) BOOST_NOEXCEPT_IF(table::nothrow_move_constructible) @@ -127,15 +105,36 @@ template class unordered_set } #endif + explicit unordered_set(allocator_type const&); + + unordered_set(unordered_set const&, allocator_type const&); + + 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()); - unordered_set(std::initializer_list, size_type, const hasher&, - const allocator_type&); +#endif + + explicit unordered_set(size_type, const allocator_type&); + + explicit unordered_set(size_type, const hasher&, const allocator_type&); + + template + unordered_set(InputIt, InputIt, size_type, const allocator_type&); + + template + unordered_set( + InputIt, InputIt, size_type, const hasher&, const allocator_type&); + +#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) unordered_set( std::initializer_list, size_type, const allocator_type&); + + unordered_set(std::initializer_list, size_type, const hasher&, + const allocator_type&); #endif // Destructor @@ -541,37 +540,14 @@ template class unordered_multiset const key_equal& = key_equal(), const allocator_type& = allocator_type()); - explicit unordered_multiset(size_type, const allocator_type&); - - explicit unordered_multiset( - size_type, const hasher&, const allocator_type&); - - explicit unordered_multiset(allocator_type const&); - - template unordered_multiset(InputIt, InputIt); - template - unordered_multiset(InputIt, InputIt, size_type, const hasher& = hasher(), - const key_equal& = key_equal()); - - template - unordered_multiset(InputIt, InputIt, size_type, const hasher&, - const key_equal&, const allocator_type&); - - template - unordered_multiset( - InputIt, InputIt, size_type, const hasher&, const allocator_type&); - - template - unordered_multiset(InputIt, InputIt, size_type, const allocator_type&); - - // copy/move constructors + unordered_multiset(InputIt, InputIt, + size_type = boost::unordered::detail::default_bucket_count, + const hasher& = hasher(), const key_equal& = key_equal(), + const allocator_type& = allocator_type()); unordered_multiset(unordered_multiset const&); - unordered_multiset(unordered_multiset const&, allocator_type const&); - unordered_multiset(BOOST_RV_REF(unordered_multiset), allocator_type const&); - #if defined(BOOST_UNORDERED_USE_MOVE) unordered_multiset(BOOST_RV_REF(unordered_multiset) other) BOOST_NOEXCEPT_IF(table::nothrow_move_constructible) @@ -586,15 +562,37 @@ template class unordered_multiset } #endif + explicit unordered_multiset(allocator_type const&); + + unordered_multiset(unordered_multiset const&, allocator_type const&); + + 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()); - unordered_multiset(std::initializer_list, size_type, - const hasher&, const allocator_type&); +#endif + + explicit unordered_multiset(size_type, const allocator_type&); + + explicit unordered_multiset( + size_type, const hasher&, const allocator_type&); + + template + unordered_multiset(InputIt, InputIt, size_type, const allocator_type&); + + template + unordered_multiset( + InputIt, InputIt, size_type, const hasher&, const allocator_type&); + +#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) unordered_multiset( std::initializer_list, size_type, const allocator_type&); + + unordered_multiset(std::initializer_list, size_type, + const hasher&, const allocator_type&); #endif // Destructor @@ -943,7 +941,6 @@ template class unordered_multiset }; // class template unordered_multiset //////////////////////////////////////////////////////////////////////////////// - template unordered_set::unordered_set() : table_(boost::unordered::detail::default_bucket_count, hasher(), @@ -959,15 +956,17 @@ unordered_set::unordered_set(size_type n, const hasher& hf, } template -unordered_set::unordered_set(size_type n, const allocator_type& a) - : table_(n, hasher(), key_equal(), a) +template +unordered_set::unordered_set(InputIt f, InputIt l, size_type n, + const hasher& hf, const key_equal& eql, const allocator_type& a) + : table_(boost::unordered::detail::initial_size(f, l, n), hf, eql, a) { + table_.insert_range(f, l); } template -unordered_set::unordered_set( - size_type n, const hasher& hf, const allocator_type& a) - : table_(n, hf, key_equal(), a) +unordered_set::unordered_set(unordered_set const& other) + : table_(other.table_) { } @@ -985,65 +984,6 @@ unordered_set::unordered_set( { } -template -template -unordered_set::unordered_set(InputIt f, InputIt l) - : table_(boost::unordered::detail::initial_size(f, l), hasher(), - key_equal(), allocator_type()) -{ - table_.insert_range(f, l); -} - -template -template -unordered_set::unordered_set( - InputIt f, InputIt l, size_type n, const hasher& hf, const key_equal& eql) - : table_(boost::unordered::detail::initial_size(f, l, n), hf, eql, - allocator_type()) -{ - table_.insert_range(f, l); -} - -template -template -unordered_set::unordered_set(InputIt f, InputIt l, size_type n, - const hasher& hf, const key_equal& eql, const allocator_type& a) - : table_(boost::unordered::detail::initial_size(f, l, n), hf, eql, a) -{ - table_.insert_range(f, l); -} - -template -template -unordered_set::unordered_set(InputIt f, InputIt l, size_type n, - const hasher& hf, const allocator_type& a) - : table_( - boost::unordered::detail::initial_size(f, l, n), hf, key_equal(), a) -{ - table_.insert_range(f, l); -} - -template -template -unordered_set::unordered_set( - InputIt f, InputIt l, size_type n, const allocator_type& a) - : table_(boost::unordered::detail::initial_size(f, l, n), hasher(), - key_equal(), a) -{ - table_.insert_range(f, l); -} - -template -unordered_set::~unordered_set() BOOST_NOEXCEPT -{ -} - -template -unordered_set::unordered_set(unordered_set const& other) - : table_(other.table_) -{ -} - template unordered_set::unordered_set( BOOST_RV_REF(unordered_set) other, allocator_type const& a) @@ -1064,16 +1004,43 @@ unordered_set::unordered_set(std::initializer_list list, table_.insert_range(list.begin(), list.end()); } +#endif + template -unordered_set::unordered_set(std::initializer_list list, - size_type n, const hasher& hf, const allocator_type& a) - : table_( - boost::unordered::detail::initial_size(list.begin(), list.end(), n), - hf, key_equal(), a) +unordered_set::unordered_set(size_type n, const allocator_type& a) + : table_(n, hasher(), key_equal(), a) { - table_.insert_range(list.begin(), list.end()); } +template +unordered_set::unordered_set( + size_type n, const hasher& hf, const allocator_type& a) + : table_(n, hf, key_equal(), a) +{ +} + +template +template +unordered_set::unordered_set( + InputIt f, InputIt l, size_type n, const allocator_type& a) + : table_(boost::unordered::detail::initial_size(f, l, n), hasher(), + key_equal(), a) +{ + table_.insert_range(f, l); +} + +template +template +unordered_set::unordered_set(InputIt f, InputIt l, size_type n, + const hasher& hf, const allocator_type& a) + : table_( + boost::unordered::detail::initial_size(f, l, n), hf, key_equal(), a) +{ + table_.insert_range(f, l); +} + +#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) + template unordered_set::unordered_set(std::initializer_list list, size_type n, const allocator_type& a) @@ -1084,6 +1051,25 @@ unordered_set::unordered_set(std::initializer_list list, table_.insert_range(list.begin(), list.end()); } +template +unordered_set::unordered_set(std::initializer_list list, + size_type n, const hasher& hf, const allocator_type& a) + : table_( + boost::unordered::detail::initial_size(list.begin(), list.end(), n), + hf, key_equal(), a) +{ + table_.insert_range(list.begin(), list.end()); +} + +#endif + +template +unordered_set::~unordered_set() BOOST_NOEXCEPT +{ +} + +#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) + template unordered_set& unordered_set::operator=( std::initializer_list list) @@ -1329,16 +1315,19 @@ unordered_multiset::unordered_multiset(size_type n, } template -unordered_multiset::unordered_multiset( - size_type n, const allocator_type& a) - : table_(n, hasher(), key_equal(), a) +template +unordered_multiset::unordered_multiset(InputIt f, InputIt l, + size_type n, const hasher& hf, const key_equal& eql, + const allocator_type& a) + : table_(boost::unordered::detail::initial_size(f, l, n), hf, eql, a) { + table_.insert_range(f, l); } template unordered_multiset::unordered_multiset( - size_type n, const hasher& hf, const allocator_type& a) - : table_(n, hf, key_equal(), a) + unordered_multiset const& other) + : table_(other.table_) { } @@ -1356,67 +1345,6 @@ unordered_multiset::unordered_multiset( { } -template -template -unordered_multiset::unordered_multiset(InputIt f, InputIt l) - : table_(boost::unordered::detail::initial_size(f, l), hasher(), - key_equal(), allocator_type()) -{ - table_.insert_range(f, l); -} - -template -template -unordered_multiset::unordered_multiset( - InputIt f, InputIt l, size_type n, const hasher& hf, const key_equal& eql) - : table_(boost::unordered::detail::initial_size(f, l, n), hf, eql, - allocator_type()) -{ - table_.insert_range(f, l); -} - -template -template -unordered_multiset::unordered_multiset(InputIt f, InputIt l, - size_type n, const hasher& hf, const key_equal& eql, - const allocator_type& a) - : table_(boost::unordered::detail::initial_size(f, l, n), hf, eql, a) -{ - table_.insert_range(f, l); -} - -template -template -unordered_multiset::unordered_multiset(InputIt f, InputIt l, - size_type n, const hasher& hf, const allocator_type& a) - : table_( - boost::unordered::detail::initial_size(f, l, n), hf, key_equal(), a) -{ - table_.insert_range(f, l); -} - -template -template -unordered_multiset::unordered_multiset( - InputIt f, InputIt l, size_type n, const allocator_type& a) - : table_(boost::unordered::detail::initial_size(f, l, n), hasher(), - key_equal(), a) -{ - table_.insert_range(f, l); -} - -template -unordered_multiset::~unordered_multiset() BOOST_NOEXCEPT -{ -} - -template -unordered_multiset::unordered_multiset( - unordered_multiset const& other) - : table_(other.table_) -{ -} - template unordered_multiset::unordered_multiset( BOOST_RV_REF(unordered_multiset) other, allocator_type const& a) @@ -1437,17 +1365,44 @@ unordered_multiset::unordered_multiset( table_.insert_range(list.begin(), list.end()); } +#endif + template unordered_multiset::unordered_multiset( - std::initializer_list list, size_type n, const hasher& hf, - const allocator_type& a) - : table_( - boost::unordered::detail::initial_size(list.begin(), list.end(), n), - hf, key_equal(), a) + size_type n, const allocator_type& a) + : table_(n, hasher(), key_equal(), a) { - table_.insert_range(list.begin(), list.end()); } +template +unordered_multiset::unordered_multiset( + size_type n, const hasher& hf, const allocator_type& a) + : table_(n, hf, key_equal(), a) +{ +} + +template +template +unordered_multiset::unordered_multiset( + InputIt f, InputIt l, size_type n, const allocator_type& a) + : table_(boost::unordered::detail::initial_size(f, l, n), hasher(), + key_equal(), a) +{ + table_.insert_range(f, l); +} + +template +template +unordered_multiset::unordered_multiset(InputIt f, InputIt l, + size_type n, const hasher& hf, const allocator_type& a) + : table_( + boost::unordered::detail::initial_size(f, l, n), hf, key_equal(), a) +{ + table_.insert_range(f, l); +} + +#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) + template unordered_multiset::unordered_multiset( std::initializer_list list, size_type n, @@ -1459,6 +1414,26 @@ unordered_multiset::unordered_multiset( table_.insert_range(list.begin(), list.end()); } +template +unordered_multiset::unordered_multiset( + std::initializer_list list, size_type n, const hasher& hf, + const allocator_type& a) + : table_( + boost::unordered::detail::initial_size(list.begin(), list.end(), n), + hf, key_equal(), a) +{ + table_.insert_range(list.begin(), list.end()); +} + +#endif + +template +unordered_multiset::~unordered_multiset() BOOST_NOEXCEPT +{ +} + +#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) + template unordered_multiset& unordered_multiset::operator=( std::initializer_list list)