unordered_map.h (unordered_map, [...]): Add missing constructors.
[gcc.git] / libstdc++-v3 / include / bits / stl_multiset.h
index 5605801671c48345b5953b0d93c4bfda0c488321..7e92836aaecf2e16b5545ff8d03ff2fb522cf9d8 100644 (file)
@@ -1,6 +1,6 @@
 // Multiset implementation -*- C++ -*-
 
-// Copyright (C) 2001-2013 Free Software Foundation, Inc.
+// Copyright (C) 2001-2015 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
@@ -263,28 +263,9 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       }
 
 #if __cplusplus >= 201103L
-      /**
-       *  @brief  %Multiset move assignment operator.
-       *  @param  __x  A %multiset of identical element and allocator types.
-       *
-       *  The contents of @a __x are moved into this %multiset
-       *  (without copying).  @a __x is a valid, but unspecified
-       *  %multiset.
-       */
+      /// Move assignment operator.
       multiset&
-      operator=(multiset&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
-      {
-       if (!_M_t._M_move_assign(__x._M_t))
-         {
-           // The rvalue's allocator cannot be moved and is not equal,
-           // so we need to individually move each element.
-           clear();
-           insert(std::__make_move_if_noexcept_iterator(__x._M_t.begin()),
-                  std::__make_move_if_noexcept_iterator(__x._M_t.end()));
-           __x.clear();
-         }
-       return *this;
-      }
+      operator=(multiset&&) = default;
 
       /**
        *  @brief  %Multiset list assignment operator.
@@ -300,8 +281,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       multiset&
       operator=(initializer_list<value_type> __l)
       {
-       this->clear();
-       this->insert(__l.begin(), __l.end());
+       _M_t._M_assign_equal(__l.begin(), __l.end());
        return *this;
       }
 #endif
@@ -463,7 +443,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
        *  improve the performance of the insertion process.  A bad hint would
        *  cause no gains in efficiency.
        *
-       *  See http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt07ch17.html
+       *  See https://gcc.gnu.org/onlinedocs/libstdc++/manual/associative.html#containers.associative.insert_hints
        *  for more on @a hinting.
        *
        *  Insertion requires logarithmic time (if the hint is not taken).
@@ -513,7 +493,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
        *  improve the performance of the insertion process.  A bad hint would
        *  cause no gains in efficiency.
        *
-       *  See http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt07ch17.html
+       *  See https://gcc.gnu.org/onlinedocs/libstdc++/manual/associative.html#containers.associative.insert_hints
        *  for more on @a hinting.
        *
        *  Insertion requires logarithmic time (if the hint is not taken).
@@ -656,6 +636,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
 
       // multiset operations:
 
+      //@{
       /**
        *  @brief Finds the number of elements with given key.
        *  @param  __x  Key of elements to be located.
@@ -665,6 +646,14 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       count(const key_type& __x) const
       { return _M_t.count(__x); }
 
+#if __cplusplus > 201103L
+      template<typename _Kt>
+       auto
+       count(const _Kt& __x) const -> decltype(_M_t._M_count_tr(__x))
+       { return _M_t._M_count_tr(__x); }
+#endif
+      //@}
+
       // _GLIBCXX_RESOLVE_LIB_DEFECTS
       // 214.  set::find() missing const overload
       //@{
@@ -686,6 +675,18 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       const_iterator
       find(const key_type& __x) const
       { return _M_t.find(__x); }
+
+#if __cplusplus > 201103L
+      template<typename _Kt>
+       auto
+       find(const _Kt& __x) -> decltype(_M_t._M_find_tr(__x))
+       { return _M_t._M_find_tr(__x); }
+
+      template<typename _Kt>
+       auto
+       find(const _Kt& __x) const -> decltype(_M_t._M_find_tr(__x))
+       { return _M_t._M_find_tr(__x); }
+#endif
       //@}
 
       //@{
@@ -707,6 +708,20 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       const_iterator
       lower_bound(const key_type& __x) const
       { return _M_t.lower_bound(__x); }
+
+#if __cplusplus > 201103L
+      template<typename _Kt>
+       auto
+       lower_bound(const _Kt& __x)
+       -> decltype(_M_t._M_lower_bound_tr(__x))
+       { return _M_t._M_lower_bound_tr(__x); }
+
+      template<typename _Kt>
+       auto
+       lower_bound(const _Kt& __x) const
+       -> decltype(_M_t._M_lower_bound_tr(__x))
+       { return _M_t._M_lower_bound_tr(__x); }
+#endif
       //@}
 
       //@{
@@ -723,6 +738,20 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       const_iterator
       upper_bound(const key_type& __x) const
       { return _M_t.upper_bound(__x); }
+
+#if __cplusplus > 201103L
+      template<typename _Kt>
+       auto
+       upper_bound(const _Kt& __x)
+       -> decltype(_M_t._M_upper_bound_tr(__x))
+       { return _M_t._M_upper_bound_tr(__x); }
+
+      template<typename _Kt>
+       auto
+       upper_bound(const _Kt& __x) const
+       -> decltype(_M_t._M_upper_bound_tr(__x))
+       { return _M_t._M_upper_bound_tr(__x); }
+#endif
       //@}
 
       //@{
@@ -748,6 +777,20 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       std::pair<const_iterator, const_iterator>
       equal_range(const key_type& __x) const
       { return _M_t.equal_range(__x); }
+
+#if __cplusplus > 201103L
+      template<typename _Kt>
+       auto
+       equal_range(const _Kt& __x)
+       -> decltype(_M_t._M_equal_range_tr(__x))
+       { return _M_t._M_equal_range_tr(__x); }
+
+      template<typename _Kt>
+       auto
+       equal_range(const _Kt& __x) const
+       -> decltype(_M_t._M_equal_range_tr(__x))
+       { return _M_t._M_equal_range_tr(__x); }
+#endif
       //@}
 
       template<typename _K1, typename _C1, typename _A1>