mirror of
https://gcc.gnu.org/git/gcc.git
synced 2025-01-23 04:44:13 +08:00
unordered_map (unordered_map<>::operator[](_Key&&)): Add.
2010-11-07 Paolo Carlini <paolo.carlini@oracle.com> * include/profile/unordered_map (unordered_map<>::operator[](_Key&&)): Add. From-SVN: r166420
This commit is contained in:
parent
bb3684703d
commit
be3c93b011
@ -1,3 +1,8 @@
|
||||
2010-11-07 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
* include/profile/unordered_map (unordered_map<>::operator[](_Key&&)):
|
||||
Add.
|
||||
|
||||
2010-11-07 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
* include/profile/bitset (bitset<>::bitset(), bitset<>::
|
||||
|
@ -232,17 +232,27 @@ namespace __profile
|
||||
_Base::insert(__first, __last);
|
||||
_M_profile_resize(__old_size, _Base::bucket_count());
|
||||
}
|
||||
|
||||
// operator []
|
||||
|
||||
// operator[]
|
||||
mapped_type&
|
||||
operator[](const _Key& _k)
|
||||
operator[](const _Key& __k)
|
||||
{
|
||||
size_type __old_size = _Base::bucket_count();
|
||||
mapped_type& __res = _M_base()[_k];
|
||||
mapped_type& __res = _M_base()[__k];
|
||||
size_type __new_size = _Base::bucket_count();
|
||||
_M_profile_resize(__old_size, _Base::bucket_count());
|
||||
return __res;
|
||||
}
|
||||
}
|
||||
|
||||
mapped_type&
|
||||
operator[](_Key&& __k)
|
||||
{
|
||||
size_type __old_size = _Base::bucket_count();
|
||||
mapped_type& __res = _M_base()[std::move(__k)];
|
||||
size_type __new_size = _Base::bucket_count();
|
||||
_M_profile_resize(__old_size, _Base::bucket_count());
|
||||
return __res;
|
||||
}
|
||||
|
||||
void
|
||||
swap(unordered_map& __x)
|
||||
|
Loading…
Reference in New Issue
Block a user