diff --git a/include/boost/unordered/concurrent_flat_map.hpp b/include/boost/unordered/concurrent_flat_map.hpp index 4bb78f3c..56a90de6 100644 --- a/include/boost/unordered/concurrent_flat_map.hpp +++ b/include/boost/unordered/concurrent_flat_map.hpp @@ -231,6 +231,27 @@ namespace boost { { } + concurrent_flat_map( + std::initializer_list il, const allocator_type& a) + : concurrent_flat_map( + il, detail::foa::default_bucket_count, hasher(), key_equal(), a) + { + } + + concurrent_flat_map(std::initializer_list il, size_type n, + const allocator_type& a) + : concurrent_flat_map(il, n, hasher(), key_equal(), a) + { + } + + concurrent_flat_map(std::initializer_list il, size_type n, + const hasher& hf, const allocator_type& a) + : concurrent_flat_map(il, n, hf, key_equal(), a) + { + } + + ~concurrent_flat_map() = default; + /// Capacity /// diff --git a/test/cfoa/constructor_tests.cpp b/test/cfoa/constructor_tests.cpp index 0d696546..4d92d6b5 100644 --- a/test/cfoa/constructor_tests.cpp +++ b/test/cfoa/constructor_tests.cpp @@ -655,14 +655,61 @@ namespace { map_value_type{raii{0}, raii{0}}, }; - raii::reset_counts(); + { + raii::reset_counts(); - map_type x(ilist, 0, hasher(1), key_equal(2), allocator_type(3)); + map_type x(ilist, 0, hasher(1), key_equal(2), allocator_type(3)); - BOOST_TEST_EQ(x.size(), 11u); - BOOST_TEST_EQ(x.hash_function(), hasher(1)); - BOOST_TEST_EQ(x.key_eq(), key_equal(2)); - BOOST_TEST(x.get_allocator() == allocator_type(3)); + BOOST_TEST_EQ(x.size(), 11u); + BOOST_TEST_EQ(x.hash_function(), hasher(1)); + BOOST_TEST_EQ(x.key_eq(), key_equal(2)); + BOOST_TEST(x.get_allocator() == allocator_type(3)); + + BOOST_TEST_EQ(raii::move_constructor, 0u); + } + check_raii_counts(); + + { + raii::reset_counts(); + + map_type x(ilist, allocator_type(3)); + + BOOST_TEST_EQ(x.size(), 11u); + BOOST_TEST_EQ(x.hash_function(), hasher()); + BOOST_TEST_EQ(x.key_eq(), key_equal()); + BOOST_TEST(x.get_allocator() == allocator_type(3)); + + BOOST_TEST_EQ(raii::move_constructor, 0u); + } + check_raii_counts(); + + { + raii::reset_counts(); + + map_type x(ilist, 0, allocator_type(3)); + + BOOST_TEST_EQ(x.size(), 11u); + BOOST_TEST_EQ(x.hash_function(), hasher()); + BOOST_TEST_EQ(x.key_eq(), key_equal()); + BOOST_TEST(x.get_allocator() == allocator_type(3)); + + BOOST_TEST_EQ(raii::move_constructor, 0u); + } + check_raii_counts(); + + { + raii::reset_counts(); + + map_type x(ilist, 0, hasher(1), allocator_type(3)); + + BOOST_TEST_EQ(x.size(), 11u); + BOOST_TEST_EQ(x.hash_function(), hasher(1)); + BOOST_TEST_EQ(x.key_eq(), key_equal()); + BOOST_TEST(x.get_allocator() == allocator_type(3)); + + BOOST_TEST_EQ(raii::move_constructor, 0u); + } + check_raii_counts(); } UNORDERED_AUTO_TEST (bucket_count_and_allocator) {