Commit fe62dd04 by François Dumont

stl_deque.h (deque): Access allocator value_type only if concept checks are enabled.

2017-03-20  François Dumont  <fdumont@gcc.gnu.org>

	* include/bits/stl_deque.h (deque): Access allocator value_type only if
	concept checks are enabled.
	* include/bits/stl_stack.h (stack): Likewise.
	* include/bits/stl_vector.h (vector): Likewise.
	* include/bits/stl_list.h (list): Likewise and check
	_SGIAssignableConcept only in C++03.
	* include/bits/stl_map.h (map): Likewise.
	* include/bits/stl_set.h (set): Likewise.
	* include/bits/stl_multimap.h (multimap): Likewise.
	* include/bits/stl_multiset.h (multiset): Likewise.
	* include/bits/stl_queue.h (queue, priority_queue): Likewise.

From-SVN: r246294
parent 92279d5f
2017-03-20 François Dumont <fdumont@gcc.gnu.org>
* include/bits/stl_deque.h (deque): Access allocator value_type only if
concept checks are enabled.
* include/bits/stl_stack.h (stack): Likewise.
* include/bits/stl_vector.h (vector): Likewise.
* include/bits/stl_list.h (list): Likewise and check
_SGIAssignableConcept only in C++03.
* include/bits/stl_map.h (map): Likewise.
* include/bits/stl_set.h (set): Likewise.
* include/bits/stl_multimap.h (multimap): Likewise.
* include/bits/stl_multiset.h (multiset): Likewise.
* include/bits/stl_queue.h (queue, priority_queue): Likewise.
2017-03-18 Gerald Pfeifer <gerald@pfeifer.com> 2017-03-18 Gerald Pfeifer <gerald@pfeifer.com>
* doc/xml/manual/appendix_contributing.xml: Convert link to * doc/xml/manual/appendix_contributing.xml: Convert link to
...@@ -351,7 +365,7 @@ ...@@ -351,7 +365,7 @@
Tweak link description. Tweak link description.
2017-02-18 Gerald Pfeifer <gerald@pfeifer.com> 2017-02-18 Gerald Pfeifer <gerald@pfeifer.com>
* doc/xml/manual/profile_mode.xml: Fix link. * doc/xml/manual/profile_mode.xml: Fix link.
2017-02-16 Gerald Pfeifer <gerald@pfeifer.com> 2017-02-16 Gerald Pfeifer <gerald@pfeifer.com>
...@@ -418,9 +432,9 @@ ...@@ -418,9 +432,9 @@
* include/bits/atomic_base.h: Re-indent. * include/bits/atomic_base.h: Re-indent.
2017-02-10 Gerald Pfeifer <gerald@pfeifer.com> 2017-02-10 Gerald Pfeifer <gerald@pfeifer.com>
* doc/xml/manual/profile_mode.xml: Update a paper reference. * doc/xml/manual/profile_mode.xml: Update a paper reference.
2017-02-08 Gerald Pfeifer <gerald@pfeifer.com> 2017-02-08 Gerald Pfeifer <gerald@pfeifer.com>
...@@ -440,16 +454,16 @@ ...@@ -440,16 +454,16 @@
* doc/html/*: Regenerate. * doc/html/*: Regenerate.
2017-02-08 Gerald Pfeifer <gerald@pfeifer.com> 2017-02-08 Gerald Pfeifer <gerald@pfeifer.com>
* doc/xml/manual/profile_mode.xml: Unbreak link to * doc/xml/manual/profile_mode.xml: Unbreak link to
"Optimizing Sorting with Machine Learning Algorithms". "Optimizing Sorting with Machine Learning Algorithms".
2017-02-08 Gerald Pfeifer <gerald@pfeifer.com> 2017-02-08 Gerald Pfeifer <gerald@pfeifer.com>
* src/c++11/snprintf_lite.cc (__err): Update bug reporting URL. * src/c++11/snprintf_lite.cc (__err): Update bug reporting URL.
2017-02-08 Gerald Pfeifer <gerald@pfeifer.com> 2017-02-08 Gerald Pfeifer <gerald@pfeifer.com>
* doc/xml/manual/abi.xml: Update link to "Sun Studio 11: C++ * doc/xml/manual/abi.xml: Update link to "Sun Studio 11: C++
Migration Guide". Migration Guide".
...@@ -714,7 +728,7 @@ ...@@ -714,7 +728,7 @@
* doc/xml/manual/debug.xml: code.google.com uses https now. * doc/xml/manual/debug.xml: code.google.com uses https now.
2017-01-22 Gerald Pfeifer <gerald@pfeifer.com> 2017-01-22 Gerald Pfeifer <gerald@pfeifer.com>
* doc/xml/manual/test.xml: Fix link into gccint online manual. * doc/xml/manual/test.xml: Fix link into gccint online manual.
2017-01-21 Ville Voutilainen <ville.voutilainen@gmail.com> 2017-01-21 Ville Voutilainen <ville.voutilainen@gmail.com>
...@@ -935,7 +949,7 @@ ...@@ -935,7 +949,7 @@
2017-01-17 Joshua Conner <joshconner@google.com> 2017-01-17 Joshua Conner <joshconner@google.com>
* crossconfig.m4: Add fuchsia OS. * crossconfig.m4: Add fuchsia OS.
* configure: Regenerate. * configure: Regenerate.
2017-01-17 Jonathan Wakely <jwakely@redhat.com> 2017-01-17 Jonathan Wakely <jwakely@redhat.com>
...@@ -1415,7 +1429,7 @@ ...@@ -1415,7 +1429,7 @@
* doc/xml/faq.xml: Update address of C++ ABI link. * doc/xml/faq.xml: Update address of C++ ABI link.
* doc/xml/manual/abi.xml: Ditto. * doc/xml/manual/abi.xml: Ditto.
2017-01-01 Jakub Jelinek <jakub@redhat.com> 2017-01-01 Jakub Jelinek <jakub@redhat.com>
Update copyright years. Update copyright years.
......
...@@ -77,7 +77,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -77,7 +77,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* @tparam _Key Type of key objects. * @tparam _Key Type of key objects.
* @tparam _Tp Type of mapped objects. * @tparam _Tp Type of mapped objects.
* @tparam _Compare Comparison function object type, defaults to less<_Key>. * @tparam _Compare Comparison function object type, defaults to less<_Key>.
* @tparam _Alloc Allocator type, defaults to * @tparam _Alloc Allocator type, defaults to
* allocator<pair<const _Key, _Tp>. * allocator<pair<const _Key, _Tp>.
* *
* Meets the requirements of a <a href="tables.html#65">container</a>, a * Meets the requirements of a <a href="tables.html#65">container</a>, a
...@@ -98,19 +98,23 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -98,19 +98,23 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
class multimap class multimap
{ {
public: public:
typedef _Key key_type; typedef _Key key_type;
typedef _Tp mapped_type; typedef _Tp mapped_type;
typedef std::pair<const _Key, _Tp> value_type; typedef std::pair<const _Key, _Tp> value_type;
typedef _Compare key_compare; typedef _Compare key_compare;
typedef _Alloc allocator_type; typedef _Alloc allocator_type;
private: private:
#ifdef _GLIBCXX_CONCEPT_CHECKS
// concept requirements // concept requirements
typedef typename _Alloc::value_type _Alloc_value_type; typedef typename _Alloc::value_type _Alloc_value_type;
# if __cplusplus < 201103L
__glibcxx_class_requires(_Tp, _SGIAssignableConcept) __glibcxx_class_requires(_Tp, _SGIAssignableConcept)
# endif
__glibcxx_class_requires4(_Compare, bool, _Key, _Key, __glibcxx_class_requires4(_Compare, bool, _Key, _Key,
_BinaryFunctionConcept) _BinaryFunctionConcept)
__glibcxx_class_requires2(value_type, _Alloc_value_type, _SameTypeConcept) __glibcxx_class_requires2(value_type, _Alloc_value_type, _SameTypeConcept)
#endif
public: public:
class value_compare class value_compare
...@@ -143,15 +147,15 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -143,15 +147,15 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
public: public:
// many of these are specified differently in ISO, but the following are // many of these are specified differently in ISO, but the following are
// "functionally equivalent" // "functionally equivalent"
typedef typename _Alloc_traits::pointer pointer; typedef typename _Alloc_traits::pointer pointer;
typedef typename _Alloc_traits::const_pointer const_pointer; typedef typename _Alloc_traits::const_pointer const_pointer;
typedef typename _Alloc_traits::reference reference; typedef typename _Alloc_traits::reference reference;
typedef typename _Alloc_traits::const_reference const_reference; typedef typename _Alloc_traits::const_reference const_reference;
typedef typename _Rep_type::iterator iterator; typedef typename _Rep_type::iterator iterator;
typedef typename _Rep_type::const_iterator const_iterator; typedef typename _Rep_type::const_iterator const_iterator;
typedef typename _Rep_type::size_type size_type; typedef typename _Rep_type::size_type size_type;
typedef typename _Rep_type::difference_type difference_type; typedef typename _Rep_type::difference_type difference_type;
typedef typename _Rep_type::reverse_iterator reverse_iterator; typedef typename _Rep_type::reverse_iterator reverse_iterator;
typedef typename _Rep_type::const_reverse_iterator const_reverse_iterator; typedef typename _Rep_type::const_reverse_iterator const_reverse_iterator;
#if __cplusplus > 201402L #if __cplusplus > 201402L
...@@ -238,10 +242,10 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -238,10 +242,10 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
/// Allocator-extended range constructor. /// Allocator-extended range constructor.
template<typename _InputIterator> template<typename _InputIterator>
multimap(_InputIterator __first, _InputIterator __last, multimap(_InputIterator __first, _InputIterator __last,
const allocator_type& __a) const allocator_type& __a)
: _M_t(_Compare(), _Pair_alloc_type(__a)) : _M_t(_Compare(), _Pair_alloc_type(__a))
{ _M_t._M_insert_equal(__first, __last); } { _M_t._M_insert_equal(__first, __last); }
#endif #endif
/** /**
...@@ -254,9 +258,9 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -254,9 +258,9 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* and NlogN otherwise (where N is distance(__first,__last)). * and NlogN otherwise (where N is distance(__first,__last)).
*/ */
template<typename _InputIterator> template<typename _InputIterator>
multimap(_InputIterator __first, _InputIterator __last) multimap(_InputIterator __first, _InputIterator __last)
: _M_t() : _M_t()
{ _M_t._M_insert_equal(__first, __last); } { _M_t._M_insert_equal(__first, __last); }
/** /**
* @brief Builds a %multimap from a range. * @brief Builds a %multimap from a range.
...@@ -270,11 +274,11 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -270,11 +274,11 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* and NlogN otherwise (where N is distance(__first,__last)). * and NlogN otherwise (where N is distance(__first,__last)).
*/ */
template<typename _InputIterator> template<typename _InputIterator>
multimap(_InputIterator __first, _InputIterator __last, multimap(_InputIterator __first, _InputIterator __last,
const _Compare& __comp, const _Compare& __comp,
const allocator_type& __a = allocator_type()) const allocator_type& __a = allocator_type())
: _M_t(__comp, _Pair_alloc_type(__a)) : _M_t(__comp, _Pair_alloc_type(__a))
{ _M_t._M_insert_equal(__first, __last); } { _M_t._M_insert_equal(__first, __last); }
#if __cplusplus >= 201103L #if __cplusplus >= 201103L
/** /**
...@@ -326,7 +330,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -326,7 +330,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
/// Get a copy of the memory allocation object. /// Get a copy of the memory allocation object.
allocator_type allocator_type
get_allocator() const _GLIBCXX_NOEXCEPT get_allocator() const _GLIBCXX_NOEXCEPT
{ return allocator_type(_M_t.get_allocator()); } { return allocator_type(_M_t.get_allocator()); }
// iterators // iterators
...@@ -530,9 +534,9 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -530,9 +534,9 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
template<typename _Pair, typename = typename template<typename _Pair, typename = typename
std::enable_if<std::is_constructible<value_type, std::enable_if<std::is_constructible<value_type,
_Pair&&>::value>::type> _Pair&&>::value>::type>
iterator iterator
insert(_Pair&& __x) insert(_Pair&& __x)
{ return _M_t._M_insert_equal(std::forward<_Pair>(__x)); } { return _M_t._M_insert_equal(std::forward<_Pair>(__x)); }
#endif #endif
/** /**
...@@ -567,9 +571,9 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -567,9 +571,9 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
template<typename _Pair, typename = typename template<typename _Pair, typename = typename
std::enable_if<std::is_constructible<value_type, std::enable_if<std::is_constructible<value_type,
_Pair&&>::value>::type> _Pair&&>::value>::type>
iterator iterator
insert(const_iterator __position, _Pair&& __x) insert(const_iterator __position, _Pair&& __x)
{ return _M_t._M_insert_equal_(__position, { return _M_t._M_insert_equal_(__position,
std::forward<_Pair>(__x)); } std::forward<_Pair>(__x)); }
#endif #endif
...@@ -583,9 +587,9 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -583,9 +587,9 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* Complexity similar to that of the range constructor. * Complexity similar to that of the range constructor.
*/ */
template<typename _InputIterator> template<typename _InputIterator>
void void
insert(_InputIterator __first, _InputIterator __last) insert(_InputIterator __first, _InputIterator __last)
{ _M_t._M_insert_equal(__first, __last); } { _M_t._M_insert_equal(__first, __last); }
#if __cplusplus >= 201103L #if __cplusplus >= 201103L
/** /**
...@@ -661,7 +665,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -661,7 +665,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* @brief Erases an element from a %multimap. * @brief Erases an element from a %multimap.
* @param __position An iterator pointing to the element to be erased. * @param __position An iterator pointing to the element to be erased.
* @return An iterator pointing to the element immediately following * @return An iterator pointing to the element immediately following
* @a position prior to the element being erased. If no such * @a position prior to the element being erased. If no such
* element exists, end() is returned. * element exists, end() is returned.
* *
* This function erases an element, pointed to by the given iterator, * This function erases an element, pointed to by the given iterator,
...@@ -1016,13 +1020,13 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -1016,13 +1020,13 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
//@} //@}
template<typename _K1, typename _T1, typename _C1, typename _A1> template<typename _K1, typename _T1, typename _C1, typename _A1>
friend bool friend bool
operator==(const multimap<_K1, _T1, _C1, _A1>&, operator==(const multimap<_K1, _T1, _C1, _A1>&,
const multimap<_K1, _T1, _C1, _A1>&); const multimap<_K1, _T1, _C1, _A1>&);
template<typename _K1, typename _T1, typename _C1, typename _A1> template<typename _K1, typename _T1, typename _C1, typename _A1>
friend bool friend bool
operator<(const multimap<_K1, _T1, _C1, _A1>&, operator<(const multimap<_K1, _T1, _C1, _A1>&,
const multimap<_K1, _T1, _C1, _A1>&); const multimap<_K1, _T1, _C1, _A1>&);
}; };
...@@ -1039,7 +1043,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -1039,7 +1043,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
template<typename _Key, typename _Tp, typename _Compare, typename _Alloc> template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
inline bool inline bool
operator==(const multimap<_Key, _Tp, _Compare, _Alloc>& __x, operator==(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
const multimap<_Key, _Tp, _Compare, _Alloc>& __y) const multimap<_Key, _Tp, _Compare, _Alloc>& __y)
{ return __x._M_t == __y._M_t; } { return __x._M_t == __y._M_t; }
/** /**
...@@ -1056,42 +1060,42 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -1056,42 +1060,42 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
template<typename _Key, typename _Tp, typename _Compare, typename _Alloc> template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
inline bool inline bool
operator<(const multimap<_Key, _Tp, _Compare, _Alloc>& __x, operator<(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
const multimap<_Key, _Tp, _Compare, _Alloc>& __y) const multimap<_Key, _Tp, _Compare, _Alloc>& __y)
{ return __x._M_t < __y._M_t; } { return __x._M_t < __y._M_t; }
/// Based on operator== /// Based on operator==
template<typename _Key, typename _Tp, typename _Compare, typename _Alloc> template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
inline bool inline bool
operator!=(const multimap<_Key, _Tp, _Compare, _Alloc>& __x, operator!=(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
const multimap<_Key, _Tp, _Compare, _Alloc>& __y) const multimap<_Key, _Tp, _Compare, _Alloc>& __y)
{ return !(__x == __y); } { return !(__x == __y); }
/// Based on operator< /// Based on operator<
template<typename _Key, typename _Tp, typename _Compare, typename _Alloc> template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
inline bool inline bool
operator>(const multimap<_Key, _Tp, _Compare, _Alloc>& __x, operator>(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
const multimap<_Key, _Tp, _Compare, _Alloc>& __y) const multimap<_Key, _Tp, _Compare, _Alloc>& __y)
{ return __y < __x; } { return __y < __x; }
/// Based on operator< /// Based on operator<
template<typename _Key, typename _Tp, typename _Compare, typename _Alloc> template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
inline bool inline bool
operator<=(const multimap<_Key, _Tp, _Compare, _Alloc>& __x, operator<=(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
const multimap<_Key, _Tp, _Compare, _Alloc>& __y) const multimap<_Key, _Tp, _Compare, _Alloc>& __y)
{ return !(__y < __x); } { return !(__y < __x); }
/// Based on operator< /// Based on operator<
template<typename _Key, typename _Tp, typename _Compare, typename _Alloc> template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
inline bool inline bool
operator>=(const multimap<_Key, _Tp, _Compare, _Alloc>& __x, operator>=(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
const multimap<_Key, _Tp, _Compare, _Alloc>& __y) const multimap<_Key, _Tp, _Compare, _Alloc>& __y)
{ return !(__x < __y); } { return !(__x < __y); }
/// See std::multimap::swap(). /// See std::multimap::swap().
template<typename _Key, typename _Tp, typename _Compare, typename _Alloc> template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
inline void inline void
swap(multimap<_Key, _Tp, _Compare, _Alloc>& __x, swap(multimap<_Key, _Tp, _Compare, _Alloc>& __x,
multimap<_Key, _Tp, _Compare, _Alloc>& __y) multimap<_Key, _Tp, _Compare, _Alloc>& __y)
_GLIBCXX_NOEXCEPT_IF(noexcept(__x.swap(__y))) _GLIBCXX_NOEXCEPT_IF(noexcept(__x.swap(__y)))
{ __x.swap(__y); } { __x.swap(__y); }
......
...@@ -94,12 +94,16 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -94,12 +94,16 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
typename _Alloc = std::allocator<_Key> > typename _Alloc = std::allocator<_Key> >
class multiset class multiset
{ {
#ifdef _GLIBCXX_CONCEPT_CHECKS
// concept requirements // concept requirements
typedef typename _Alloc::value_type _Alloc_value_type; typedef typename _Alloc::value_type _Alloc_value_type;
# if __cplusplus < 201103L
__glibcxx_class_requires(_Key, _SGIAssignableConcept) __glibcxx_class_requires(_Key, _SGIAssignableConcept)
# endif
__glibcxx_class_requires4(_Compare, bool, _Key, _Key, __glibcxx_class_requires4(_Compare, bool, _Key, _Key,
_BinaryFunctionConcept) _BinaryFunctionConcept)
__glibcxx_class_requires2(_Key, _Alloc_value_type, _SameTypeConcept) __glibcxx_class_requires2(_Key, _Alloc_value_type, _SameTypeConcept)
#endif
public: public:
// typedefs: // typedefs:
...@@ -122,19 +126,19 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -122,19 +126,19 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
typedef __gnu_cxx::__alloc_traits<_Key_alloc_type> _Alloc_traits; typedef __gnu_cxx::__alloc_traits<_Key_alloc_type> _Alloc_traits;
public: public:
typedef typename _Alloc_traits::pointer pointer; typedef typename _Alloc_traits::pointer pointer;
typedef typename _Alloc_traits::const_pointer const_pointer; typedef typename _Alloc_traits::const_pointer const_pointer;
typedef typename _Alloc_traits::reference reference; typedef typename _Alloc_traits::reference reference;
typedef typename _Alloc_traits::const_reference const_reference; typedef typename _Alloc_traits::const_reference const_reference;
// _GLIBCXX_RESOLVE_LIB_DEFECTS // _GLIBCXX_RESOLVE_LIB_DEFECTS
// DR 103. set::iterator is required to be modifiable, // DR 103. set::iterator is required to be modifiable,
// but this allows modification of keys. // but this allows modification of keys.
typedef typename _Rep_type::const_iterator iterator; typedef typename _Rep_type::const_iterator iterator;
typedef typename _Rep_type::const_iterator const_iterator; typedef typename _Rep_type::const_iterator const_iterator;
typedef typename _Rep_type::const_reverse_iterator reverse_iterator; typedef typename _Rep_type::const_reverse_iterator reverse_iterator;
typedef typename _Rep_type::const_reverse_iterator const_reverse_iterator; typedef typename _Rep_type::const_reverse_iterator const_reverse_iterator;
typedef typename _Rep_type::size_type size_type; typedef typename _Rep_type::size_type size_type;
typedef typename _Rep_type::difference_type difference_type; typedef typename _Rep_type::difference_type difference_type;
#if __cplusplus > 201402L #if __cplusplus > 201402L
using node_type = typename _Rep_type::node_type; using node_type = typename _Rep_type::node_type;
...@@ -170,9 +174,9 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -170,9 +174,9 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* and NlogN otherwise (where N is distance(__first,__last)). * and NlogN otherwise (where N is distance(__first,__last)).
*/ */
template<typename _InputIterator> template<typename _InputIterator>
multiset(_InputIterator __first, _InputIterator __last) multiset(_InputIterator __first, _InputIterator __last)
: _M_t() : _M_t()
{ _M_t._M_insert_equal(__first, __last); } { _M_t._M_insert_equal(__first, __last); }
/** /**
* @brief Builds a %multiset from a range. * @brief Builds a %multiset from a range.
...@@ -186,11 +190,11 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -186,11 +190,11 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* and NlogN otherwise (where N is distance(__first,__last)). * and NlogN otherwise (where N is distance(__first,__last)).
*/ */
template<typename _InputIterator> template<typename _InputIterator>
multiset(_InputIterator __first, _InputIterator __last, multiset(_InputIterator __first, _InputIterator __last,
const _Compare& __comp, const _Compare& __comp,
const allocator_type& __a = allocator_type()) const allocator_type& __a = allocator_type())
: _M_t(__comp, _Key_alloc_type(__a)) : _M_t(__comp, _Key_alloc_type(__a))
{ _M_t._M_insert_equal(__first, __last); } { _M_t._M_insert_equal(__first, __last); }
/** /**
* @brief %Multiset copy constructor. * @brief %Multiset copy constructor.
...@@ -250,10 +254,10 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -250,10 +254,10 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
/// Allocator-extended range constructor. /// Allocator-extended range constructor.
template<typename _InputIterator> template<typename _InputIterator>
multiset(_InputIterator __first, _InputIterator __last, multiset(_InputIterator __first, _InputIterator __last,
const allocator_type& __a) const allocator_type& __a)
: _M_t(_Compare(), _Key_alloc_type(__a)) : _M_t(_Compare(), _Key_alloc_type(__a))
{ _M_t._M_insert_equal(__first, __last); } { _M_t._M_insert_equal(__first, __last); }
/** /**
* The dtor only erases the elements, and note that if the elements * The dtor only erases the elements, and note that if the elements
...@@ -533,9 +537,9 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -533,9 +537,9 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* Complexity similar to that of the range constructor. * Complexity similar to that of the range constructor.
*/ */
template<typename _InputIterator> template<typename _InputIterator>
void void
insert(_InputIterator __first, _InputIterator __last) insert(_InputIterator __first, _InputIterator __last)
{ _M_t._M_insert_equal(__first, __last); } { _M_t._M_insert_equal(__first, __last); }
#if __cplusplus >= 201103L #if __cplusplus >= 201103L
/** /**
...@@ -611,7 +615,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -611,7 +615,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* @brief Erases an element from a %multiset. * @brief Erases an element from a %multiset.
* @param __position An iterator pointing to the element to be erased. * @param __position An iterator pointing to the element to be erased.
* @return An iterator pointing to the element immediately following * @return An iterator pointing to the element immediately following
* @a position prior to the element being erased. If no such * @a position prior to the element being erased. If no such
* element exists, end() is returned. * element exists, end() is returned.
* *
* This function erases an element, pointed to by the given iterator, * This function erases an element, pointed to by the given iterator,
...@@ -866,13 +870,13 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -866,13 +870,13 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
//@} //@}
template<typename _K1, typename _C1, typename _A1> template<typename _K1, typename _C1, typename _A1>
friend bool friend bool
operator==(const multiset<_K1, _C1, _A1>&, operator==(const multiset<_K1, _C1, _A1>&,
const multiset<_K1, _C1, _A1>&); const multiset<_K1, _C1, _A1>&);
template<typename _K1, typename _C1, typename _A1> template<typename _K1, typename _C1, typename _A1>
friend bool friend bool
operator< (const multiset<_K1, _C1, _A1>&, operator< (const multiset<_K1, _C1, _A1>&,
const multiset<_K1, _C1, _A1>&); const multiset<_K1, _C1, _A1>&);
}; };
......
...@@ -95,20 +95,24 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -95,20 +95,24 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename _Tp, typename _Sequence = deque<_Tp> > template<typename _Tp, typename _Sequence = deque<_Tp> >
class queue class queue
{ {
#ifdef _GLIBCXX_CONCEPT_CHECKS
// concept requirements // concept requirements
typedef typename _Sequence::value_type _Sequence_value_type; typedef typename _Sequence::value_type _Sequence_value_type;
# if __cplusplus < 201103L
__glibcxx_class_requires(_Tp, _SGIAssignableConcept) __glibcxx_class_requires(_Tp, _SGIAssignableConcept)
# endif
__glibcxx_class_requires(_Sequence, _FrontInsertionSequenceConcept) __glibcxx_class_requires(_Sequence, _FrontInsertionSequenceConcept)
__glibcxx_class_requires(_Sequence, _BackInsertionSequenceConcept) __glibcxx_class_requires(_Sequence, _BackInsertionSequenceConcept)
__glibcxx_class_requires2(_Tp, _Sequence_value_type, _SameTypeConcept) __glibcxx_class_requires2(_Tp, _Sequence_value_type, _SameTypeConcept)
#endif
template<typename _Tp1, typename _Seq1> template<typename _Tp1, typename _Seq1>
friend bool friend bool
operator==(const queue<_Tp1, _Seq1>&, const queue<_Tp1, _Seq1>&); operator==(const queue<_Tp1, _Seq1>&, const queue<_Tp1, _Seq1>&);
template<typename _Tp1, typename _Seq1> template<typename _Tp1, typename _Seq1>
friend bool friend bool
operator<(const queue<_Tp1, _Seq1>&, const queue<_Tp1, _Seq1>&); operator<(const queue<_Tp1, _Seq1>&, const queue<_Tp1, _Seq1>&);
#if __cplusplus >= 201103L #if __cplusplus >= 201103L
template<typename _Alloc> template<typename _Alloc>
...@@ -117,11 +121,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -117,11 +121,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
#endif #endif
public: public:
typedef typename _Sequence::value_type value_type; typedef typename _Sequence::value_type value_type;
typedef typename _Sequence::reference reference; typedef typename _Sequence::reference reference;
typedef typename _Sequence::const_reference const_reference; typedef typename _Sequence::const_reference const_reference;
typedef typename _Sequence::size_type size_type; typedef typename _Sequence::size_type size_type;
typedef _Sequence container_type; typedef _Sequence container_type;
protected: protected:
/* Maintainers wondering why this isn't uglified as per style /* Maintainers wondering why this isn't uglified as per style
...@@ -259,8 +263,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -259,8 +263,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return c.emplace_back(std::forward<_Args>(__args)...); } { return c.emplace_back(std::forward<_Args>(__args)...); }
#else #else
template<typename... _Args> template<typename... _Args>
void void
emplace(_Args&&... __args) emplace(_Args&&... __args)
{ c.emplace_back(std::forward<_Args>(__args)...); } { c.emplace_back(std::forward<_Args>(__args)...); }
#endif #endif
#endif #endif
...@@ -381,12 +385,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -381,12 +385,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
* *
* @tparam _Tp Type of element. * @tparam _Tp Type of element.
* @tparam _Sequence Type of underlying sequence, defaults to vector<_Tp>. * @tparam _Sequence Type of underlying sequence, defaults to vector<_Tp>.
* @tparam _Compare Comparison function object type, defaults to * @tparam _Compare Comparison function object type, defaults to
* less<_Sequence::value_type>. * less<_Sequence::value_type>.
* *
* This is not a true container, but an @e adaptor. It holds * This is not a true container, but an @e adaptor. It holds
* another container, and provides a wrapper interface to that * another container, and provides a wrapper interface to that
* container. The wrapper is what enforces priority-based sorting * container. The wrapper is what enforces priority-based sorting
* and %queue behavior. Very few of the standard container/sequence * and %queue behavior. Very few of the standard container/sequence
* interface requirements are met (e.g., iterators). * interface requirements are met (e.g., iterators).
* *
...@@ -418,14 +422,18 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -418,14 +422,18 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
typename _Compare = less<typename _Sequence::value_type> > typename _Compare = less<typename _Sequence::value_type> >
class priority_queue class priority_queue
{ {
#ifdef _GLIBCXX_CONCEPT_CHECKS
// concept requirements // concept requirements
typedef typename _Sequence::value_type _Sequence_value_type; typedef typename _Sequence::value_type _Sequence_value_type;
# if __cplusplus < 201103L
__glibcxx_class_requires(_Tp, _SGIAssignableConcept) __glibcxx_class_requires(_Tp, _SGIAssignableConcept)
# endif
__glibcxx_class_requires(_Sequence, _SequenceConcept) __glibcxx_class_requires(_Sequence, _SequenceConcept)
__glibcxx_class_requires(_Sequence, _RandomAccessContainerConcept) __glibcxx_class_requires(_Sequence, _RandomAccessContainerConcept)
__glibcxx_class_requires2(_Tp, _Sequence_value_type, _SameTypeConcept) __glibcxx_class_requires2(_Tp, _Sequence_value_type, _SameTypeConcept)
__glibcxx_class_requires4(_Compare, bool, _Tp, _Tp, __glibcxx_class_requires4(_Compare, bool, _Tp, _Tp,
_BinaryFunctionConcept) _BinaryFunctionConcept)
#endif
#if __cplusplus >= 201103L #if __cplusplus >= 201103L
template<typename _Alloc> template<typename _Alloc>
...@@ -434,11 +442,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -434,11 +442,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
#endif #endif
public: public:
typedef typename _Sequence::value_type value_type; typedef typename _Sequence::value_type value_type;
typedef typename _Sequence::reference reference; typedef typename _Sequence::reference reference;
typedef typename _Sequence::const_reference const_reference; typedef typename _Sequence::const_reference const_reference;
typedef typename _Sequence::size_type size_type; typedef typename _Sequence::size_type size_type;
typedef _Sequence container_type; typedef _Sequence container_type;
// _GLIBCXX_RESOLVE_LIB_DEFECTS // _GLIBCXX_RESOLVE_LIB_DEFECTS
// DR 2684. priority_queue lacking comparator typedef // DR 2684. priority_queue lacking comparator typedef
typedef _Compare value_compare; typedef _Compare value_compare;
...@@ -461,7 +469,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -461,7 +469,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
#else #else
template<typename _Seq = _Sequence, typename _Requires = typename template<typename _Seq = _Sequence, typename _Requires = typename
enable_if<__and_<is_default_constructible<_Compare>, enable_if<__and_<is_default_constructible<_Compare>,
is_default_constructible<_Seq>>::value>::type> is_default_constructible<_Seq>>::value>::type>
priority_queue() priority_queue()
: c(), comp() { } : c(), comp() { }
...@@ -519,33 +527,33 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -519,33 +527,33 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
*/ */
#if __cplusplus < 201103L #if __cplusplus < 201103L
template<typename _InputIterator> template<typename _InputIterator>
priority_queue(_InputIterator __first, _InputIterator __last, priority_queue(_InputIterator __first, _InputIterator __last,
const _Compare& __x = _Compare(), const _Compare& __x = _Compare(),
const _Sequence& __s = _Sequence()) const _Sequence& __s = _Sequence())
: c(__s), comp(__x) : c(__s), comp(__x)
{ {
__glibcxx_requires_valid_range(__first, __last); __glibcxx_requires_valid_range(__first, __last);
c.insert(c.end(), __first, __last); c.insert(c.end(), __first, __last);
std::make_heap(c.begin(), c.end(), comp); std::make_heap(c.begin(), c.end(), comp);
} }
#else #else
template<typename _InputIterator> template<typename _InputIterator>
priority_queue(_InputIterator __first, _InputIterator __last, priority_queue(_InputIterator __first, _InputIterator __last,
const _Compare& __x, const _Compare& __x,
const _Sequence& __s) const _Sequence& __s)
: c(__s), comp(__x) : c(__s), comp(__x)
{ {
__glibcxx_requires_valid_range(__first, __last); __glibcxx_requires_valid_range(__first, __last);
c.insert(c.end(), __first, __last); c.insert(c.end(), __first, __last);
std::make_heap(c.begin(), c.end(), comp); std::make_heap(c.begin(), c.end(), comp);
} }
template<typename _InputIterator> template<typename _InputIterator>
priority_queue(_InputIterator __first, _InputIterator __last, priority_queue(_InputIterator __first, _InputIterator __last,
const _Compare& __x = _Compare(), const _Compare& __x = _Compare(),
_Sequence&& __s = _Sequence()) _Sequence&& __s = _Sequence())
: c(std::move(__s)), comp(__x) : c(std::move(__s)), comp(__x)
{ {
__glibcxx_requires_valid_range(__first, __last); __glibcxx_requires_valid_range(__first, __last);
c.insert(c.end(), __first, __last); c.insert(c.end(), __first, __last);
std::make_heap(c.begin(), c.end(), comp); std::make_heap(c.begin(), c.end(), comp);
...@@ -599,8 +607,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -599,8 +607,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
} }
template<typename... _Args> template<typename... _Args>
void void
emplace(_Args&&... __args) emplace(_Args&&... __args)
{ {
c.emplace_back(std::forward<_Args>(__args)...); c.emplace_back(std::forward<_Args>(__args)...);
std::push_heap(c.begin(), c.end(), comp); std::push_heap(c.begin(), c.end(), comp);
...@@ -631,12 +639,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -631,12 +639,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
swap(priority_queue& __pq) swap(priority_queue& __pq)
noexcept(__and_< noexcept(__and_<
#if __cplusplus > 201402L || !defined(__STRICT_ANSI__) // c++1z or gnu++11 #if __cplusplus > 201402L || !defined(__STRICT_ANSI__) // c++1z or gnu++11
__is_nothrow_swappable<_Sequence>, __is_nothrow_swappable<_Sequence>,
#else #else
__is_nothrow_swappable<_Tp>, __is_nothrow_swappable<_Tp>,
#endif #endif
__is_nothrow_swappable<_Compare> __is_nothrow_swappable<_Compare>
>::value) >::value)
{ {
using std::swap; using std::swap;
swap(c, __pq.c); swap(c, __pq.c);
...@@ -653,7 +661,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -653,7 +661,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
#if __cplusplus > 201402L || !defined(__STRICT_ANSI__) // c++1z or gnu++11 #if __cplusplus > 201402L || !defined(__STRICT_ANSI__) // c++1z or gnu++11
// Constrained free swap overload, see p0185r1 // Constrained free swap overload, see p0185r1
typename enable_if<__and_<__is_swappable<_Sequence>, typename enable_if<__and_<__is_swappable<_Sequence>,
__is_swappable<_Compare>>::value>::type __is_swappable<_Compare>>::value>::type
#else #else
void void
#endif #endif
......
...@@ -92,12 +92,16 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -92,12 +92,16 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
typename _Alloc = std::allocator<_Key> > typename _Alloc = std::allocator<_Key> >
class set class set
{ {
#ifdef _GLIBCXX_CONCEPT_CHECKS
// concept requirements // concept requirements
typedef typename _Alloc::value_type _Alloc_value_type; typedef typename _Alloc::value_type _Alloc_value_type;
# if __cplusplus < 201103L
__glibcxx_class_requires(_Key, _SGIAssignableConcept) __glibcxx_class_requires(_Key, _SGIAssignableConcept)
# endif
__glibcxx_class_requires4(_Compare, bool, _Key, _Key, __glibcxx_class_requires4(_Compare, bool, _Key, _Key,
_BinaryFunctionConcept) _BinaryFunctionConcept)
__glibcxx_class_requires2(_Key, _Alloc_value_type, _SameTypeConcept) __glibcxx_class_requires2(_Key, _Alloc_value_type, _SameTypeConcept)
#endif
public: public:
// typedefs: // typedefs:
...@@ -123,19 +127,19 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -123,19 +127,19 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
public: public:
//@{ //@{
/// Iterator-related typedefs. /// Iterator-related typedefs.
typedef typename _Alloc_traits::pointer pointer; typedef typename _Alloc_traits::pointer pointer;
typedef typename _Alloc_traits::const_pointer const_pointer; typedef typename _Alloc_traits::const_pointer const_pointer;
typedef typename _Alloc_traits::reference reference; typedef typename _Alloc_traits::reference reference;
typedef typename _Alloc_traits::const_reference const_reference; typedef typename _Alloc_traits::const_reference const_reference;
// _GLIBCXX_RESOLVE_LIB_DEFECTS // _GLIBCXX_RESOLVE_LIB_DEFECTS
// DR 103. set::iterator is required to be modifiable, // DR 103. set::iterator is required to be modifiable,
// but this allows modification of keys. // but this allows modification of keys.
typedef typename _Rep_type::const_iterator iterator; typedef typename _Rep_type::const_iterator iterator;
typedef typename _Rep_type::const_iterator const_iterator; typedef typename _Rep_type::const_iterator const_iterator;
typedef typename _Rep_type::const_reverse_iterator reverse_iterator; typedef typename _Rep_type::const_reverse_iterator reverse_iterator;
typedef typename _Rep_type::const_reverse_iterator const_reverse_iterator; typedef typename _Rep_type::const_reverse_iterator const_reverse_iterator;
typedef typename _Rep_type::size_type size_type; typedef typename _Rep_type::size_type size_type;
typedef typename _Rep_type::difference_type difference_type; typedef typename _Rep_type::difference_type difference_type;
//@} //@}
#if __cplusplus > 201402L #if __cplusplus > 201402L
...@@ -195,7 +199,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -195,7 +199,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
const _Compare& __comp, const _Compare& __comp,
const allocator_type& __a = allocator_type()) const allocator_type& __a = allocator_type())
: _M_t(__comp, _Key_alloc_type(__a)) : _M_t(__comp, _Key_alloc_type(__a))
{ _M_t._M_insert_unique(__first, __last); } { _M_t._M_insert_unique(__first, __last); }
/** /**
* @brief %Set copy constructor. * @brief %Set copy constructor.
...@@ -254,10 +258,10 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -254,10 +258,10 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
/// Allocator-extended range constructor. /// Allocator-extended range constructor.
template<typename _InputIterator> template<typename _InputIterator>
set(_InputIterator __first, _InputIterator __last, set(_InputIterator __first, _InputIterator __last,
const allocator_type& __a) const allocator_type& __a)
: _M_t(_Compare(), _Key_alloc_type(__a)) : _M_t(_Compare(), _Key_alloc_type(__a))
{ _M_t._M_insert_unique(__first, __last); } { _M_t._M_insert_unique(__first, __last); }
/** /**
* The dtor only erases the elements, and note that if the elements * The dtor only erases the elements, and note that if the elements
......
...@@ -98,21 +98,23 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -98,21 +98,23 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename _Tp, typename _Sequence = deque<_Tp> > template<typename _Tp, typename _Sequence = deque<_Tp> >
class stack class stack
{ {
#ifdef _GLIBCXX_CONCEPT_CHECKS
// concept requirements // concept requirements
typedef typename _Sequence::value_type _Sequence_value_type; typedef typename _Sequence::value_type _Sequence_value_type;
#if __cplusplus < 201103L # if __cplusplus < 201103L
__glibcxx_class_requires(_Tp, _SGIAssignableConcept) __glibcxx_class_requires(_Tp, _SGIAssignableConcept)
__glibcxx_class_requires(_Sequence, _BackInsertionSequenceConcept) __glibcxx_class_requires(_Sequence, _BackInsertionSequenceConcept)
#endif # endif
__glibcxx_class_requires2(_Tp, _Sequence_value_type, _SameTypeConcept) __glibcxx_class_requires2(_Tp, _Sequence_value_type, _SameTypeConcept)
#endif
template<typename _Tp1, typename _Seq1> template<typename _Tp1, typename _Seq1>
friend bool friend bool
operator==(const stack<_Tp1, _Seq1>&, const stack<_Tp1, _Seq1>&); operator==(const stack<_Tp1, _Seq1>&, const stack<_Tp1, _Seq1>&);
template<typename _Tp1, typename _Seq1> template<typename _Tp1, typename _Seq1>
friend bool friend bool
operator<(const stack<_Tp1, _Seq1>&, const stack<_Tp1, _Seq1>&); operator<(const stack<_Tp1, _Seq1>&, const stack<_Tp1, _Seq1>&);
#if __cplusplus >= 201103L #if __cplusplus >= 201103L
template<typename _Alloc> template<typename _Alloc>
...@@ -121,11 +123,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -121,11 +123,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
#endif #endif
public: public:
typedef typename _Sequence::value_type value_type; typedef typename _Sequence::value_type value_type;
typedef typename _Sequence::reference reference; typedef typename _Sequence::reference reference;
typedef typename _Sequence::const_reference const_reference; typedef typename _Sequence::const_reference const_reference;
typedef typename _Sequence::size_type size_type; typedef typename _Sequence::size_type size_type;
typedef _Sequence container_type; typedef _Sequence container_type;
protected: protected:
// See queue::c for notes on this name. // See queue::c for notes on this name.
...@@ -235,8 +237,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -235,8 +237,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return c.emplace_back(std::forward<_Args>(__args)...); } { return c.emplace_back(std::forward<_Args>(__args)...); }
#else #else
template<typename... _Args> template<typename... _Args>
void void
emplace(_Args&&... __args) emplace(_Args&&... __args)
{ c.emplace_back(std::forward<_Args>(__args)...); } { c.emplace_back(std::forward<_Args>(__args)...); }
#endif #endif
#endif #endif
......
...@@ -78,7 +78,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -78,7 +78,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
typedef typename __gnu_cxx::__alloc_traits<_Tp_alloc_type>::pointer typedef typename __gnu_cxx::__alloc_traits<_Tp_alloc_type>::pointer
pointer; pointer;
struct _Vector_impl struct _Vector_impl
: public _Tp_alloc_type : public _Tp_alloc_type
{ {
pointer _M_start; pointer _M_start;
...@@ -107,7 +107,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -107,7 +107,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
std::swap(_M_end_of_storage, __x._M_end_of_storage); std::swap(_M_end_of_storage, __x._M_end_of_storage);
} }
}; };
public: public:
typedef _Alloc allocator_type; typedef _Alloc allocator_type;
...@@ -215,13 +215,15 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -215,13 +215,15 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
template<typename _Tp, typename _Alloc = std::allocator<_Tp> > template<typename _Tp, typename _Alloc = std::allocator<_Tp> >
class vector : protected _Vector_base<_Tp, _Alloc> class vector : protected _Vector_base<_Tp, _Alloc>
{ {
#ifdef _GLIBCXX_CONCEPT_CHECKS
// Concept requirements. // Concept requirements.
typedef typename _Alloc::value_type _Alloc_value_type; typedef typename _Alloc::value_type _Alloc_value_type;
#if __cplusplus < 201103L # if __cplusplus < 201103L
__glibcxx_class_requires(_Tp, _SGIAssignableConcept) __glibcxx_class_requires(_Tp, _SGIAssignableConcept)
#endif # endif
__glibcxx_class_requires2(_Tp, _Alloc_value_type, _SameTypeConcept) __glibcxx_class_requires2(_Tp, _Alloc_value_type, _SameTypeConcept)
#endif
typedef _Vector_base<_Tp, _Alloc> _Base; typedef _Vector_base<_Tp, _Alloc> _Base;
typedef typename _Base::_Tp_alloc_type _Tp_alloc_type; typedef typename _Base::_Tp_alloc_type _Tp_alloc_type;
typedef __gnu_cxx::__alloc_traits<_Tp_alloc_type> _Alloc_traits; typedef __gnu_cxx::__alloc_traits<_Tp_alloc_type> _Alloc_traits;
...@@ -842,7 +844,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -842,7 +844,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
at(size_type __n) at(size_type __n)
{ {
_M_range_check(__n); _M_range_check(__n);
return (*this)[__n]; return (*this)[__n];
} }
/** /**
...@@ -895,7 +897,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -895,7 +897,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
__glibcxx_requires_nonempty(); __glibcxx_requires_nonempty();
return *(end() - 1); return *(end() - 1);
} }
/** /**
* Returns a read-only (constant) reference to the data at the * Returns a read-only (constant) reference to the data at the
* last element of the %vector. * last element of the %vector.
...@@ -953,7 +955,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -953,7 +955,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
template<typename... _Args> template<typename... _Args>
#if __cplusplus > 201402L #if __cplusplus > 201402L
reference reference
#else #else
void void
#endif #endif
...@@ -1045,7 +1047,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -1045,7 +1047,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* @param __position An iterator into the %vector. * @param __position An iterator into the %vector.
* @param __l An initializer_list. * @param __l An initializer_list.
* *
* This function will insert copies of the data in the * This function will insert copies of the data in the
* initializer_list @a l into the %vector before the location * initializer_list @a l into the %vector before the location
* specified by @a position. * specified by @a position.
* *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment