mirror of git://gcc.gnu.org/git/gcc.git
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>
|
2010-11-07 Paolo Carlini <paolo.carlini@oracle.com>
|
||||||
|
|
||||||
* include/profile/bitset (bitset<>::bitset(), bitset<>::
|
* include/profile/bitset (bitset<>::bitset(), bitset<>::
|
||||||
|
|
|
@ -233,12 +233,22 @@ namespace __profile
|
||||||
_M_profile_resize(__old_size, _Base::bucket_count());
|
_M_profile_resize(__old_size, _Base::bucket_count());
|
||||||
}
|
}
|
||||||
|
|
||||||
// operator []
|
// operator[]
|
||||||
mapped_type&
|
mapped_type&
|
||||||
operator[](const _Key& _k)
|
operator[](const _Key& __k)
|
||||||
{
|
{
|
||||||
size_type __old_size = _Base::bucket_count();
|
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();
|
size_type __new_size = _Base::bucket_count();
|
||||||
_M_profile_resize(__old_size, _Base::bucket_count());
|
_M_profile_resize(__old_size, _Base::bucket_count());
|
||||||
return __res;
|
return __res;
|
||||||
|
|
Loading…
Reference in New Issue