Add last remaining constructors

This commit is contained in:
Christian Mazakas
2023-04-21 10:33:21 -07:00
parent 7f7e577e77
commit 88d4d64edf
2 changed files with 74 additions and 6 deletions

View File

@ -231,6 +231,27 @@ namespace boost {
{
}
concurrent_flat_map(
std::initializer_list<value_type> il, const allocator_type& a)
: concurrent_flat_map(
il, detail::foa::default_bucket_count, hasher(), key_equal(), a)
{
}
concurrent_flat_map(std::initializer_list<value_type> il, size_type n,
const allocator_type& a)
: concurrent_flat_map(il, n, hasher(), key_equal(), a)
{
}
concurrent_flat_map(std::initializer_list<value_type> 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
///

View File

@ -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) {