Commit efe2962d authored by Nathan Bronson's avatar Nathan Bronson Committed by Facebook GitHub Bot

fix forwarding for hinted insert_or_assign

Summary:
The hinted forms of insert_or_assign were forwarding with
std::move rather than std::forward, which has the potential to elevate
a non-const lvalue ref to an rvalue ref.

(Note: this ignores all push blocking failures!)

Reviewed By: yfeldblum

Differential Revision: D21475865

fbshipit-source-id: e91e759762cf6f045c843cd7de1402953e6afb61
parent cc16262f
......@@ -392,12 +392,12 @@ class F14BasicMap {
template <typename M>
iterator
insert_or_assign(const_iterator /*hint*/, key_type const& key, M&& obj) {
return insert_or_assign(key, std::move(obj)).first;
return insert_or_assign(key, std::forward<M>(obj)).first;
}
template <typename M>
iterator insert_or_assign(const_iterator /*hint*/, key_type&& key, M&& obj) {
return insert_or_assign(std::move(key), std::move(obj)).first;
return insert_or_assign(std::move(key), std::forward<M>(obj)).first;
}
template <typename K, typename M>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment