summaryrefslogtreecommitdiffstats
path: root/libstdc++-v3/include/debug/unordered_set
diff options
context:
space:
mode:
authorfdumont <fdumont@138bc75d-0d04-0410-961f-82ee72b054a4>2011-12-09 20:01:04 +0000
committerfdumont <fdumont@138bc75d-0d04-0410-961f-82ee72b054a4>2011-12-09 20:01:04 +0000
commitbd142bda50bb4bdc9f870e3d6e2a6cd050cf3f80 (patch)
treedba467050250a28c9ead1c5187c57648cec07cd2 /libstdc++-v3/include/debug/unordered_set
parenta25f8869d0bffb0ba81e69f031c206c197305036 (diff)
downloadppe42-gcc-bd142bda50bb4bdc9f870e3d6e2a6cd050cf3f80.tar.gz
ppe42-gcc-bd142bda50bb4bdc9f870e3d6e2a6cd050cf3f80.zip
2011-12-09 François Dumont <fdumont@gcc.gnu.org>
* include/bits/hashtable.h (_Hashtable<>::emplace, _Hashtable<>::emplace_hint): Add. * include/debug/unordered_set (unordered_set<>::emplace, unordered_set<>::emplace_hint, unordered_multiset<>::emplace, unordered_multiset<>::emplace_hint): Add. * include/profile/unordered_set: Likewise. * include/debug/unordered_map (unordered_map<>::emplace, unordered_map<>::emplace_hint, unordered_multimap<>::emplace, unordered_multimap<>::emplace_hint): Add. * include/profile/unordered_map: Likewise. * testsuite/23_containers/unordered_map/modifiers/emplace.cc: New. * testsuite/23_containers/unordered_multimap/modifiers/emplace.cc: New. * testsuite/23_containers/unordered_set/modifiers/emplace.cc: New. * testsuite/23_containers/unordered_multiset/modifiers/emplace.cc: New. * testsuite/util/testsuite_container_traits.h (traits_base::has_emplace): Add and defined as std::true_type for unordered containers. * testsuite/util/exception/safety.h (emplace, emplace_hint): Add and use them in basic_safety exception test case. * doc/xml/manual/status_cxx2011.xml: Update unordered containers status. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@182174 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/debug/unordered_set')
-rw-r--r--libstdc++-v3/include/debug/unordered_set46
1 files changed, 46 insertions, 0 deletions
diff --git a/libstdc++-v3/include/debug/unordered_set b/libstdc++-v3/include/debug/unordered_set
index 2f41bc3a25d..ba4404028e3 100644
--- a/libstdc++-v3/include/debug/unordered_set
+++ b/libstdc++-v3/include/debug/unordered_set
@@ -204,6 +204,29 @@ namespace __debug
cend(size_type __b) const
{ return const_local_iterator(_Base::cend(__b), __b, this); }
+ template<typename... _Args>
+ std::pair<iterator, bool>
+ emplace(_Args&&... __args)
+ {
+ size_type __bucket_count = this->bucket_count();
+ std::pair<_Base_iterator, bool> __res
+ = _Base::emplace(std::forward<_Args>(__args)...);
+ _M_check_rehashed(__bucket_count);
+ return std::make_pair(iterator(__res.first, this), __res.second);
+ }
+
+ template<typename... _Args>
+ iterator
+ emplace_hint(const_iterator __hint, _Args&&... __args)
+ {
+ __glibcxx_check_insert(__hint);
+ size_type __bucket_count = this->bucket_count();
+ _Base_iterator __it = _Base::emplace_hint(__hint.base(),
+ std::forward<_Args>(__args)...);
+ _M_check_rehashed(__bucket_count);
+ return iterator(__it, this);
+ }
+
std::pair<iterator, bool>
insert(const value_type& __obj)
{
@@ -582,6 +605,29 @@ namespace __debug
cend(size_type __b) const
{ return const_local_iterator(_Base::cend(__b), __b, this); }
+ template<typename... _Args>
+ iterator
+ emplace(_Args&&... __args)
+ {
+ size_type __bucket_count = this->bucket_count();
+ _Base_iterator __it
+ = _Base::emplace(std::forward<_Args>(__args)...);
+ _M_check_rehashed(__bucket_count);
+ return iterator(__it, this);
+ }
+
+ template<typename... _Args>
+ iterator
+ emplace_hint(const_iterator __hint, _Args&&... __args)
+ {
+ __glibcxx_check_insert(__hint);
+ size_type __bucket_count = this->bucket_count();
+ _Base_iterator __it = _Base::emplace_hint(__hint.base(),
+ std::forward<_Args>(__args)...);
+ _M_check_rehashed(__bucket_count);
+ return iterator(__it, this);
+ }
+
iterator
insert(const value_type& __obj)
{
OpenPOWER on IntegriCloud