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:
Paolo Carlini 2010-11-07 18:56:56 +00:00 committed by Paolo Carlini
parent bb3684703d
commit be3c93b011
2 changed files with 20 additions and 5 deletions

View File

@ -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<>::

View File

@ -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)