diff options
Diffstat (limited to 'libstdc++-v3/include/debug')
-rw-r--r-- | libstdc++-v3/include/debug/unordered_map | 36 | ||||
-rw-r--r-- | libstdc++-v3/include/debug/unordered_set | 24 |
2 files changed, 60 insertions, 0 deletions
diff --git a/libstdc++-v3/include/debug/unordered_map b/libstdc++-v3/include/debug/unordered_map index 2e2f9122ee0..6f37e040a26 100644 --- a/libstdc++-v3/include/debug/unordered_map +++ b/libstdc++-v3/include/debug/unordered_map @@ -190,6 +190,28 @@ namespace __debug return iterator(__res.first, this); } + template<typename _Pair, typename = typename + std::enable_if<std::is_convertible<_Pair, + value_type>::value>::type> + std::pair<iterator, bool> + insert(_Pair&& __obj) + { + typedef std::pair<typename _Base::iterator, bool> __pair_type; + __pair_type __res = _Base::insert(std::forward<_Pair>(__obj)); + return std::make_pair(iterator(__res.first, this), __res.second); + } + + template<typename _Pair, typename = typename + std::enable_if<std::is_convertible<_Pair, + value_type>::value>::type> + iterator + insert(const_iterator, _Pair&& __obj) + { + typedef std::pair<typename _Base::iterator, bool> __pair_type; + __pair_type __res = _Base::insert(std::forward<_Pair>(__obj)); + return iterator(__res.first, this); + } + void insert(std::initializer_list<value_type> __l) { _Base::insert(__l); } @@ -444,6 +466,20 @@ namespace __debug insert(const_iterator, const value_type& __obj) { return iterator(_Base::insert(__obj), this); } + template<typename _Pair, typename = typename + std::enable_if<std::is_convertible<_Pair, + value_type>::value>::type> + iterator + insert(_Pair&& __obj) + { return iterator(_Base::insert(std::forward<_Pair>(__obj)), this); } + + template<typename _Pair, typename = typename + std::enable_if<std::is_convertible<_Pair, + value_type>::value>::type> + iterator + insert(const_iterator, _Pair&& __obj) + { return iterator(_Base::insert(std::forward<_Pair>(__obj)), this); } + void insert(std::initializer_list<value_type> __l) { _Base::insert(__l); } diff --git a/libstdc++-v3/include/debug/unordered_set b/libstdc++-v3/include/debug/unordered_set index ea90c675476..1d42905e236 100644 --- a/libstdc++-v3/include/debug/unordered_set +++ b/libstdc++-v3/include/debug/unordered_set @@ -190,6 +190,22 @@ namespace __debug return iterator(__res.first, this); } + std::pair<iterator, bool> + insert(value_type&& __obj) + { + typedef std::pair<typename _Base::iterator, bool> __pair_type; + __pair_type __res = _Base::insert(std::move(__obj)); + return std::make_pair(iterator(__res.first, this), __res.second); + } + + iterator + insert(const_iterator, value_type&& __obj) + { + typedef std::pair<typename _Base::iterator, bool> __pair_type; + __pair_type __res = _Base::insert(std::move(__obj)); + return iterator(__res.first, this); + } + void insert(std::initializer_list<value_type> __l) { _Base::insert(__l); } @@ -440,6 +456,14 @@ namespace __debug insert(const_iterator, const value_type& __obj) { return iterator(_Base::insert(__obj), this); } + iterator + insert(value_type&& __obj) + { return iterator(_Base::insert(std::move(__obj)), this); } + + iterator + insert(const_iterator, value_type&& __obj) + { return iterator(_Base::insert(std::move(__obj)), this); } + void insert(std::initializer_list<value_type> __l) { _Base::insert(__l); } |