Implement emplace, emplace_or_[c]visit

This commit is contained in:
Christian Mazakas
2023-04-05 13:21:18 -07:00
parent ddcab1c171
commit a004e71dd0
4 changed files with 187 additions and 0 deletions

View File

@@ -270,6 +270,23 @@ namespace boost {
this->insert_or_visit(ilist.begin(), ilist.end(), f);
}
template <class... Args> bool emplace(Args&&... args)
{
return table_.emplace(std::forward<Args>(args)...);
}
template <class F, class... Args>
bool emplace_or_visit(F f, Args&&... args)
{
return table_.emplace_or_visit(f, std::forward<Args>(args)...);
}
template <class F, class... Args>
bool emplace_or_cvisit(F f, Args&&... args)
{
return table_.emplace_or_cvisit(f, std::forward<Args>(args)...);
}
template <class... Args>
bool try_emplace(key_type const& k, Args&&... args)
{