summaryrefslogtreecommitdiff
path: root/libstdc++-v3/include/debug/map.h
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2016-02-10 17:20:51 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2016-02-10 17:20:51 +0000
commit2d9d01985a7a7866916fafa19c5c296702e69714 (patch)
tree259c095c65fc0c6279b7a17755b3f851f51babb3 /libstdc++-v3/include/debug/map.h
parentc8ebeb0e3c6b093e649592be7d51d1c0032a1dc7 (diff)
downloadgcc-2d9d01985a7a7866916fafa19c5c296702e69714.tar.gz
2016-02-10 Basile Starynkevitch <basile@starynkevitch.net>
{{merging with even more of GCC 6, using subversion 1.9 svn merge -r227001:227400 ^/trunk ; there is some gengtype issue before svn r228000... }} git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@233281 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/debug/map.h')
-rw-r--r--libstdc++-v3/include/debug/map.h83
1 files changed, 83 insertions, 0 deletions
diff --git a/libstdc++-v3/include/debug/map.h b/libstdc++-v3/include/debug/map.h
index d45cf793e9d..914d7215037 100644
--- a/libstdc++-v3/include/debug/map.h
+++ b/libstdc++-v3/include/debug/map.h
@@ -317,6 +317,89 @@ namespace __debug
_Base::insert(__first, __last);
}
+
+#if __cplusplus > 201402L
+ template <typename... _Args>
+ pair<iterator, bool>
+ try_emplace(const key_type& __k, _Args&&... __args)
+ {
+ auto __res = _Base::try_emplace(__k,
+ std::forward<_Args>(__args)...);
+ return { iterator(__res.first, this), __res.second };
+ }
+
+ template <typename... _Args>
+ pair<iterator, bool>
+ try_emplace(key_type&& __k, _Args&&... __args)
+ {
+ auto __res = _Base::try_emplace(std::move(__k),
+ std::forward<_Args>(__args)...);
+ return { iterator(__res.first, this), __res.second };
+ }
+
+ template <typename... _Args>
+ iterator
+ try_emplace(const_iterator __hint, const key_type& __k,
+ _Args&&... __args)
+ {
+ __glibcxx_check_insert(__hint);
+ return iterator(_Base::try_emplace(__hint.base(), __k,
+ std::forward<_Args>(__args)...),
+ this);
+ }
+
+ template <typename... _Args>
+ iterator
+ try_emplace(const_iterator __hint, key_type&& __k, _Args&&... __args)
+ {
+ __glibcxx_check_insert(__hint);
+ return iterator(_Base::try_emplace(__hint.base(), std::move(__k),
+ std::forward<_Args>(__args)...),
+ this);
+ }
+
+ template <typename _Obj>
+ std::pair<iterator, bool>
+ insert_or_assign(const key_type& __k, _Obj&& __obj)
+ {
+ auto __res = _Base::insert_or_assign(__k,
+ std::forward<_Obj>(__obj));
+ return { iterator(__res.first, this), __res.second };
+ }
+
+ template <typename _Obj>
+ std::pair<iterator, bool>
+ insert_or_assign(key_type&& __k, _Obj&& __obj)
+ {
+ auto __res = _Base::insert_or_assign(std::move(__k),
+ std::forward<_Obj>(__obj));
+ return { iterator(__res.first, this), __res.second };
+ }
+
+ template <typename _Obj>
+ iterator
+ insert_or_assign(const_iterator __hint,
+ const key_type& __k, _Obj&& __obj)
+ {
+ __glibcxx_check_insert(__hint);
+ return iterator(_Base::insert_or_assign(__hint.base(), __k,
+ std::forward<_Obj>(__obj)),
+ this);
+ }
+
+ template <typename _Obj>
+ iterator
+ insert_or_assign(const_iterator __hint, key_type&& __k, _Obj&& __obj)
+ {
+ __glibcxx_check_insert(__hint);
+ return iterator(_Base::insert_or_assign(__hint.base(),
+ std::move(__k),
+ std::forward<_Obj>(__obj)),
+ this);
+ }
+#endif
+
+
#if __cplusplus >= 201103L
iterator
erase(const_iterator __position)