Implement initializer_list assignment

This commit is contained in:
Christian Mazakas
2023-04-27 12:00:42 -07:00
parent 0959df1896
commit 187fd3e71e
3 changed files with 91 additions and 6 deletions
@@ -267,6 +267,12 @@ namespace boost {
return *this;
}
concurrent_flat_map& operator=(std::initializer_list<value_type> ilist)
{
table_ = ilist;
return *this;
}
/// Capacity
///
@@ -410,6 +410,18 @@ public:
return *this;
}
concurrent_table& operator=(std::initializer_list<value_type> il) {
auto lck=exclusive_access();
super::clear();
if (super::capacity()<il.size()) {
super::reserve(il.size());
}
for (auto const& v : il) {
this->unprotected_emplace(v);
}
return *this;
}
allocator_type get_allocator()const noexcept
{
auto lck=shared_access();