forked from boostorg/unordered
updated insert_or_assign impls to f-last interface
This commit is contained in:
@ -255,15 +255,15 @@ namespace boost {
|
|||||||
template <class M> bool insert_or_assign(key_type const& k, M&& obj)
|
template <class M> bool insert_or_assign(key_type const& k, M&& obj)
|
||||||
{
|
{
|
||||||
return table_.try_emplace_or_visit(
|
return table_.try_emplace_or_visit(
|
||||||
k, [&](value_type& m) { m.second = std::forward<M>(obj); },
|
k, std::forward<M>(obj),
|
||||||
std::forward<M>(obj));
|
[&](value_type& m) { m.second = std::forward<M>(obj); });
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class M> bool insert_or_assign(key_type&& k, M&& obj)
|
template <class M> bool insert_or_assign(key_type&& k, M&& obj)
|
||||||
{
|
{
|
||||||
return table_.try_emplace_or_visit(
|
return table_.try_emplace_or_visit(
|
||||||
std::move(k), [&](value_type& m) { m.second = std::forward<M>(obj); },
|
std::move(k), std::forward<M>(obj),
|
||||||
std::forward<M>(obj));
|
[&](value_type& m) { m.second = std::forward<M>(obj); });
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K, class M>
|
template <class K, class M>
|
||||||
@ -272,9 +272,8 @@ namespace boost {
|
|||||||
insert_or_assign(K&& k, M&& obj)
|
insert_or_assign(K&& k, M&& obj)
|
||||||
{
|
{
|
||||||
return table_.try_emplace_or_visit(
|
return table_.try_emplace_or_visit(
|
||||||
std::forward<K>(k),
|
std::forward<K>(k), std::forward<M>(obj),
|
||||||
[&](value_type& m) { m.second = std::forward<M>(obj); },
|
[&](value_type& m) { m.second = std::forward<M>(obj); });
|
||||||
std::forward<M>(obj));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class F> bool insert_or_visit(value_type const& obj, F f)
|
template <class F> bool insert_or_visit(value_type const& obj, F f)
|
||||||
@ -494,4 +493,4 @@ namespace boost {
|
|||||||
#undef BOOST_UNORDERED_STATIC_ASSERT_INVOCABLE
|
#undef BOOST_UNORDERED_STATIC_ASSERT_INVOCABLE
|
||||||
#undef BOOST_UNORDERED_STATIC_ASSERT_CONST_INVOCABLE
|
#undef BOOST_UNORDERED_STATIC_ASSERT_CONST_INVOCABLE
|
||||||
|
|
||||||
#endif // BOOST_UNORDERED_CONCURRENT_FLAT_MAP_HPP
|
#endif // BOOST_UNORDERED_CONCURRENT_FLAT_MAP_HPP
|
||||||
|
Reference in New Issue
Block a user