Implement missing constructors outlined by LWG issue 2713 (#160)

* Harden initializer_list constructor tests

* Add tests for constructors as specified in LWG issue 2713

* Add missing constructors to unordered_flat_map

* Add missing constructors to unordered_flat_set

* Add missing constructors to unordered_[multi]map

* Add missing constructors to unordered_[multi]set
This commit is contained in:
Christian Mazakas
2022-11-05 05:08:29 -07:00
committed by GitHub
parent d3985f87b3
commit 4310809025
5 changed files with 317 additions and 33 deletions

View File

@@ -121,6 +121,9 @@ namespace boost {
explicit unordered_set(size_type, const hasher&, const allocator_type&);
template <class InputIterator>
unordered_set(InputIterator, InputIterator, const allocator_type&);
template <class InputIt>
unordered_set(InputIt, InputIt, size_type, const allocator_type&);
@@ -129,6 +132,8 @@ namespace boost {
InputIt, InputIt, size_type, const hasher&, const allocator_type&);
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
unordered_set(std::initializer_list<value_type>, const allocator_type&);
unordered_set(
std::initializer_list<value_type>, size_type, const allocator_type&);
@@ -739,6 +744,9 @@ namespace boost {
explicit unordered_multiset(
size_type, const hasher&, const allocator_type&);
template <class InputIterator>
unordered_multiset(InputIterator, InputIterator, const allocator_type&);
template <class InputIt>
unordered_multiset(InputIt, InputIt, size_type, const allocator_type&);
@@ -747,6 +755,9 @@ namespace boost {
InputIt, InputIt, size_type, const hasher&, const allocator_type&);
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
unordered_multiset(
std::initializer_list<value_type>, const allocator_type&);
unordered_multiset(
std::initializer_list<value_type>, size_type, const allocator_type&);
@@ -1352,6 +1363,17 @@ namespace boost {
{
}
template <class T, class H, class P, class A>
template <class InputIterator>
unordered_set<T, H, P, A>::unordered_set(
InputIterator f, InputIterator l, const allocator_type& a)
: table_(boost::unordered::detail::initial_size(
f, l, detail::default_bucket_count),
hasher(), key_equal(), a)
{
this->insert(f, l);
}
template <class T, class H, class P, class A>
template <class InputIt>
unordered_set<T, H, P, A>::unordered_set(
@@ -1374,6 +1396,16 @@ namespace boost {
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
template <class T, class H, class P, class A>
unordered_set<T, H, P, A>::unordered_set(
std::initializer_list<value_type> list, const allocator_type& a)
: table_(boost::unordered::detail::initial_size(
list.begin(), list.end(), detail::default_bucket_count),
hasher(), key_equal(), a)
{
this->insert(list.begin(), list.end());
}
template <class T, class H, class P, class A>
unordered_set<T, H, P, A>::unordered_set(
std::initializer_list<value_type> list, size_type n,
@@ -1750,6 +1782,17 @@ namespace boost {
{
}
template <class T, class H, class P, class A>
template <class InputIterator>
unordered_multiset<T, H, P, A>::unordered_multiset(
InputIterator f, InputIterator l, const allocator_type& a)
: table_(boost::unordered::detail::initial_size(
f, l, detail::default_bucket_count),
hasher(), key_equal(), a)
{
this->insert(f, l);
}
template <class T, class H, class P, class A>
template <class InputIt>
unordered_multiset<T, H, P, A>::unordered_multiset(
@@ -1772,6 +1815,16 @@ namespace boost {
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
template <class T, class H, class P, class A>
unordered_multiset<T, H, P, A>::unordered_multiset(
std::initializer_list<value_type> list, const allocator_type& a)
: table_(boost::unordered::detail::initial_size(
list.begin(), list.end(), detail::default_bucket_count),
hasher(), key_equal(), a)
{
this->insert(list.begin(), list.end());
}
template <class T, class H, class P, class A>
unordered_multiset<T, H, P, A>::unordered_multiset(
std::initializer_list<value_type> list, size_type n,