修改pods
This commit is contained in:
14
Pods/abseil/absl/container/internal/raw_hash_map.h
generated
14
Pods/abseil/absl/container/internal/raw_hash_map.h
generated
@@ -198,22 +198,24 @@ class raw_hash_map : public raw_hash_set<Policy, Hash, Eq, Alloc> {
|
||||
std::pair<iterator, bool> insert_or_assign_impl(K&& k, V&& v)
|
||||
ABSL_ATTRIBUTE_LIFETIME_BOUND {
|
||||
auto res = this->find_or_prepare_insert(k);
|
||||
if (res.second)
|
||||
if (res.second) {
|
||||
this->emplace_at(res.first, std::forward<K>(k), std::forward<V>(v));
|
||||
else
|
||||
Policy::value(&*this->iterator_at(res.first)) = std::forward<V>(v);
|
||||
return {this->iterator_at(res.first), res.second};
|
||||
} else {
|
||||
Policy::value(&*res.first) = std::forward<V>(v);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
template <class K = key_type, class... Args>
|
||||
std::pair<iterator, bool> try_emplace_impl(K&& k, Args&&... args)
|
||||
ABSL_ATTRIBUTE_LIFETIME_BOUND {
|
||||
auto res = this->find_or_prepare_insert(k);
|
||||
if (res.second)
|
||||
if (res.second) {
|
||||
this->emplace_at(res.first, std::piecewise_construct,
|
||||
std::forward_as_tuple(std::forward<K>(k)),
|
||||
std::forward_as_tuple(std::forward<Args>(args)...));
|
||||
return {this->iterator_at(res.first), res.second};
|
||||
}
|
||||
return res;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user