forked from boostorg/unordered
Implement initializer_list assignment
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user