aboutsummaryrefslogtreecommitdiff
path: root/include/map
diff options
context:
space:
mode:
Diffstat (limited to 'include/map')
-rw-r--r--include/map42
1 files changed, 28 insertions, 14 deletions
diff --git a/include/map b/include/map
index adfb4cdb5e9e..87add437a545 100644
--- a/include/map
+++ b/include/map
@@ -126,9 +126,11 @@ public:
template <class... Args>
iterator emplace_hint(const_iterator position, Args&&... args);
pair<iterator, bool> insert(const value_type& v);
+ pair<iterator, bool> insert( value_type&& v); // C++17
template <class P>
pair<iterator, bool> insert(P&& p);
iterator insert(const_iterator position, const value_type& v);
+ iterator insert(const_iterator position, value_type&& v); // C++17
template <class P>
iterator insert(const_iterator position, P&& p);
template <class InputIterator>
@@ -336,9 +338,11 @@ public:
template <class... Args>
iterator emplace_hint(const_iterator position, Args&&... args);
iterator insert(const value_type& v);
+ iterator insert( value_type&& v); // C++17
template <class P>
iterator insert(P&& p);
iterator insert(const_iterator position, const value_type& v);
+ iterator insert(const_iterator position, value_type&& v); // C++17
template <class P>
iterator insert(const_iterator position, P&& p);
template <class InputIterator>
@@ -704,13 +708,8 @@ public:
typedef pair<__key_type, __mapped_type> value_type;
typedef typename _TreeIterator::difference_type difference_type;
typedef value_type& reference;
- typedef typename __pointer_traits::template
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
- rebind<value_type>
-#else
- rebind<value_type>::other
-#endif
- pointer;
+ typedef typename __rebind_pointer<typename __pointer_traits::pointer, value_type>::type
+ pointer;
_LIBCPP_INLINE_VISIBILITY
__map_iterator() _NOEXCEPT {}
@@ -770,13 +769,8 @@ public:
typedef pair<__key_type, __mapped_type> value_type;
typedef typename _TreeIterator::difference_type difference_type;
typedef const value_type& reference;
- typedef typename __pointer_traits::template
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
- rebind<const value_type>
-#else
- rebind<const value_type>::other
-#endif
- pointer;
+ typedef typename __rebind_pointer<typename __pointer_traits::pointer, const value_type>::type
+ pointer;
_LIBCPP_INLINE_VISIBILITY
__map_const_iterator() _NOEXCEPT {}
@@ -1099,6 +1093,17 @@ public:
insert(const_iterator __p, const value_type& __v)
{return __tree_.__insert_unique(__p.__i_, __v);}
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
+ _LIBCPP_INLINE_VISIBILITY
+ pair<iterator, bool>
+ insert( value_type&& __v) {return __tree_.__insert_unique(_VSTD::forward<value_type>(__v));}
+
+ _LIBCPP_INLINE_VISIBILITY
+ iterator
+ insert(const_iterator __p, value_type&& __v)
+ {return __tree_.__insert_unique(__p.__i_, _VSTD::forward<value_type>(__v));}
+#endif
+
template <class _InputIterator>
_LIBCPP_INLINE_VISIBILITY
void insert(_InputIterator __f, _InputIterator __l)
@@ -1950,6 +1955,15 @@ public:
iterator insert(const_iterator __p, const value_type& __v)
{return __tree_.__insert_multi(__p.__i_, __v);}
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
+ _LIBCPP_INLINE_VISIBILITY
+ iterator insert( value_type&& __v) {return __tree_.__insert_multi(_VSTD::forward<value_type>(__v));}
+
+ _LIBCPP_INLINE_VISIBILITY
+ iterator insert(const_iterator __p, value_type&& __v)
+ {return __tree_.__insert_multi(__p.__i_, _VSTD::forward<value_type>(__v));}
+#endif
+
template <class _InputIterator>
_LIBCPP_INLINE_VISIBILITY
void insert(_InputIterator __f, _InputIterator __l)