diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index f0f89ca0848..62f3dc26f26 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,27 @@
+2003-06-10 Phil Edwards
+
+ * docs/html/17_intro/BUGS: Update from 2.90.8 snapshot.
+ * docs/html/17_intro/CHECKLIST: Bring up to date with respect to
+ correctness of container::iterator typedefs. Fix whitespace.
+ * docs/html/20_util/howto.html, docs/html/ext/howto.html: Add links
+ to allocator docs.
+ * docs/html/documentation.html: Regenerate.
+
+ * include/bits/basic_string.h, include/bits/basic_string.tcc,
+ include/bits/deque.tcc, include/bits/list.tcc, include/bits/stl_algo.h,
+ include/bits/stl_algobase.h, include/bits/stl_bvector.h,
+ include/bits/stl_deque.h, include/bits/stl_iterator_base_funcs.h,
+ include/bits/stl_list.h, include/bits/stl_uninitialized.h,
+ include/bits/stl_vector.h, include/bits/vector.tcc,
+ include/ext/algorithm, include/ext/slist, include/std/std_bitset.h:
+ Change _Iter names to _Iterator, and __pos to __position.
+
+ * include/bits/stl_relops.h, include/bits/stl_numeric.h,
+ include/bits/stl_multiset.h, include/bits/stl_set.h:
+ Remove emacs markers.
+
+ * include/bits/stl_threads.h (_STL_auto_lock): Add __unused__.
+
2003-06-10 Paolo Carlini
* include/bits/fstream.tcc (overflow): According to
diff --git a/libstdc++-v3/docs/html/17_intro/BUGS b/libstdc++-v3/docs/html/17_intro/BUGS
index 04e4bc80623..e71304d0666 100644
--- a/libstdc++-v3/docs/html/17_intro/BUGS
+++ b/libstdc++-v3/docs/html/17_intro/BUGS
@@ -1,7 +1,4 @@
-2000-03-24 libstdc++2.90.8
-
-- testsuite/27_io/istream_extractors_char.cc:
- Failing on all platforms with -O2, working with -O. Need to look at this.
+2003-04-26
- _GLIBCPP_HAS_BUILTIN_SINF: We should still hold out for a cleaner solution the is currenly the case in bits/std_cmath.h.
diff --git a/libstdc++-v3/docs/html/17_intro/CHECKLIST b/libstdc++-v3/docs/html/17_intro/CHECKLIST
index 9d3f80d3e36..ad02b0d8731 100644
--- a/libstdc++-v3/docs/html/17_intro/CHECKLIST
+++ b/libstdc++-v3/docs/html/17_intro/CHECKLIST
@@ -1,6 +1,6 @@
Completion Checklist for the Standard C++ Library
- Updated: 1999-05-18
+ Updated: 2003-04-25
Status Code Legend:
M - Missing
@@ -17,10 +17,8 @@
issues appear [in brackets].
Note that this checklist does not (yet) include all emendations
- recommended by the ISO Library Working Group: (restricted site)
- http://www.cygnus.com/iso/wp/html/fdis/lwg-issues.html
- The LWG has announced its intention to release a public version
- of the issues list, URL to be added here. XXX
+ recommended by the ISO Library Working Group:
+ http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-toc.html
Detailed explanation of status codes:
@@ -36,7 +34,7 @@
It may have an incorrect base class, wrong namespace, wrong
storage class, or simply not fully implement requirements.
However, it may be sufficiently usable to help test other
- components.
+ components.
T - Implemented, pending test/inspection: Implementation believed
to be complete, and informal testing suggests it is ready for
@@ -49,14 +47,14 @@
Inspected, "implementation-defined" documentation accepted,
local usability criteria satisfied, formally inspected for
other untestable conformance. (Untestable requirements
- include exception-safety, thread-safety, worst-case
- complexity, memory cleanliness, usefulness.)
+ include exception-safety, thread-safety, worst-case
+ complexity, memory cleanliness, usefulness.)
P - Portability verified: Qualified on all primary target platforms.
C - Certified: Formally certified to have passed all tests,
inspections, qualifications; approved under "signing authority"
- to be used to satisfy contractual guarantees.
+ to be used to satisfy contractual guarantees.
----------------------------------------------------------------------
@@ -89,11 +87,11 @@ X wctrans_t, wctype_t, and wint_t.
subroutines is implementation-defined.
18.1 Types [lib.support.types]
-X
-X NULL
-X offsetof
-X ptrdiff_t
-X size_t
+X
+X NULL
+X offsetof
+X ptrdiff_t
+X size_t
18.2 Implementation properties [lib.support.limits]
@@ -101,9 +99,6 @@ X size_t
18.2.1 Numeric limits [lib.limits]
- [Note: the numeric_limits templates are now automatically
- generated. ]
-
X template class numeric_limits;
T enum float_round_style;
@@ -192,7 +187,7 @@ T denorm present = 1;
1 Header (Table 3):
CHAR_BIT INT_MAX LONG_MIN SCHAR_MIN UCHAR_MAX USHRT_MAX
-X CHAR_MAX INT_MIN MB_LEN_MAX SHRT_MAX UINT_MAX
+X CHAR_MAX INT_MIN MB_LEN_MAX SHRT_MAX UINT_MAX
CHAR_MIN LONG_MAX SCHAR_MAX SHRT_MIN ULONG_MAX
3 Header (Table 4):
@@ -457,7 +452,7 @@ X |Macros: EDOM ERANGE errno |
Header synopsis
// _lib.operators_, operators:
-X namespace rel_ops {
+T namespace rel_ops {
T template bool operator!=(const T&, const T&);
T template bool operator> (const T&, const T&);
T template bool operator<=(const T&, const T&);
@@ -2280,7 +2275,7 @@ X Functions: localeconv setlocale
Header synopsis
-X template > class deque;
+T template > class deque;
T template
bool operator==(const deque& x, const deque& y);
T template
@@ -2299,7 +2294,7 @@ T template
Header synopsis
-X template > class list;
+T template > class list;
T template
bool operator==(const list& x, const list& y);
T template
@@ -2319,7 +2314,7 @@ T template
Header synopsis
namespace std {
-X template > class queue;
+T template > class queue;
T template
bool operator==(const queue& x,
const queue& y);
@@ -2418,13 +2413,13 @@ T template
23.2.1 Template class deque [lib.deque]
template >
-X class deque {
+T class deque {
public:
// types:
T typedef typename Allocator::reference reference;
T typedef typename Allocator::const_reference const_reference;
-X typedef implementation defined iterator;
-X typedef implementation defined const_iterator;
+T typedef implementation defined iterator;
+T typedef implementation defined const_iterator;
T typedef implementation defined size_type;
T typedef implementation defined difference_type;
T typedef T value_type;
@@ -2511,14 +2506,14 @@ T template
23.2.2 Template class list [lib.list]
-X template >
+T template >
class list {
public:
// types:
T typedef typename Allocator::reference reference;
T typedef typename Allocator::const_reference const_reference;
-X typedef implementation defined iterator;
-X typedef implementation defined const_iterator;
+T typedef implementation defined iterator;
+T typedef implementation defined const_iterator;
T typedef implementation defined size_type;
T typedef implementation defined difference_type;
T typedef T value_type;
@@ -2720,13 +2715,13 @@ T template
23.2.4 Template class vector [lib.vector]
template >
-X class vector {
+T class vector {
public:
// types:
T typedef typename Allocator::reference reference;
T typedef typename Allocator::const_reference const_reference;
-X typedef implementation defined iterator;
-X typedef implementation defined const_iterator;
+T typedef implementation defined iterator;
+T typedef implementation defined const_iterator;
T typedef implementation defined size_type;
T typedef implementation defined difference_type;
T typedef T value_type;
@@ -2814,12 +2809,12 @@ T template
23.2.5 Class vector [lib.vector.bool]
-X template class vector {
+T template class vector {
public:
// types:
T typedef bool const_reference;
-X typedef implementation defined iterator;
-X typedef implementation defined const_iterator;
+T typedef implementation defined iterator;
+T typedef implementation defined const_iterator;
T typedef implementation defined size_type;
T typedef implementation defined difference_type;
T typedef bool value_type;
@@ -2925,7 +2920,7 @@ T template
template ,
class Allocator = allocator > >
-X class map;
+T class map;
T template
bool operator==(const map& x,
@@ -2978,7 +2973,7 @@ T template
template ,
class Allocator = allocator >
-X class set;
+T class set;
T template
bool operator==(const set& x,
@@ -3031,7 +3026,7 @@ T template
template ,
class Allocator = allocator > >
-X class map {
+T class map {
public:
// types:
T typedef Key key_type;
@@ -3041,8 +3036,8 @@ T typedef Compare key_compare;
T typedef Allocator allocator_type;
T typedef typename Allocator::reference reference;
T typedef typename Allocator::const_reference const_reference;
-X typedef implementation defined iterator;
-X typedef implementation defined const_iterator;
+T typedef implementation defined iterator;
+T typedef implementation defined const_iterator;
T typedef implementation defined size_type;
T typedef implementation defined difference_type;
T typedef typename Allocator::pointer pointer;
@@ -3140,7 +3135,7 @@ T template
template ,
class Allocator = allocator > >
-X class multimap {
+T class multimap {
public:
// types:
T typedef Key key_type;
@@ -3150,8 +3145,8 @@ T typedef Compare key_compare;
T typedef Allocator allocator_type;
T typedef typename Allocator::reference reference;
T typedef typename Allocator::const_reference const_reference;
-X typedef implementation defined iterator;
-X typedef implementation defined const_iterator;
+T typedef implementation defined iterator;
+T typedef implementation defined const_iterator;
T typedef implementation defined size_type;
T typedef implementation defined difference_type
T typedef typename Allocator::pointer pointer;
@@ -3248,7 +3243,7 @@ T template
template ,
class Allocator = allocator >
-X class set {
+T class set {
public:
// types:
T typedef Key key_type;
@@ -3258,8 +3253,8 @@ T typedef Compare value_compare;
T typedef Allocator allocator_type;
T typedef typename Allocator::reference reference;
T typedef typename Allocator::const_reference const_reference;
-X typedef implementation defined iterator;
-X typedef implementation defined const_iterator;
+T typedef implementation defined iterator;
+T typedef implementation defined const_iterator;
T typedef implementation defined size_type;
T typedef implementation defined difference_type;
T typedef typename Allocator::pointer pointer;
@@ -3338,7 +3333,7 @@ T template
template ,
class Allocator = allocator >
-X class multiset {
+T class multiset {
public:
// types:
T typedef Key key_type;
@@ -3348,8 +3343,8 @@ T typedef Compare value_compare;
T typedef Allocator allocator_type;
T typedef typename Allocator::reference reference;
T typedef typename Allocator::const_reference const_reference;
-X typedef implementation defined iterator;
-X typedef implementation defined const_iterator;
+T typedef implementation defined iterator;
+T typedef implementation defined const_iterator;
T typedef implementation defined size_type;
T typedef implementation defined difference_type
T typedef typename Allocator::pointer pointer;
@@ -3430,14 +3425,7 @@ T template
Header synopsis
- [What's this stuff?
- #include // for size_t
- #include
- #include // for invalid_argument,
- // out_of_range, overflow_error
- #include // for istream, ostream
- ]
-X template class bitset;
+T template class bitset;
// _lib.bitset.operators_ bitset operations:
T template
bitset operator&(const bitset&, const bitset&);
@@ -3452,7 +3440,7 @@ T template
basic_ostream&
operator<<(basic_ostream& os, const bitset& x);
-X template class bitset {
+T template class bitset {
public:
// bit reference:
T class reference {
diff --git a/libstdc++-v3/docs/html/20_util/howto.html b/libstdc++-v3/docs/html/20_util/howto.html
index 9952849c0fb..af40bceae0e 100644
--- a/libstdc++-v3/docs/html/20_util/howto.html
+++ b/libstdc++-v3/docs/html/20_util/howto.html
@@ -30,6 +30,7 @@
auto_ptr
inside container classes
Functors
Pairs
+ Memory allocators
@@ -207,7 +208,14 @@
to the FAQ.
-
+
+
+ The available free store ("heap") management classes are
+ described here.
+
+ Return to top of page or
+ to the FAQ.
+
diff --git a/libstdc++-v3/docs/html/documentation.html b/libstdc++-v3/docs/html/documentation.html
index 778999d9687..68f79f7f3c4 100644
--- a/libstdc++-v3/docs/html/documentation.html
+++ b/libstdc++-v3/docs/html/documentation.html
@@ -143,6 +143,7 @@
auto_ptr
inside container classes
Functors
Pairs
+ Memory allocators
@@ -222,8 +223,8 @@
- Ropes and trees and hashes, oh my!
- Added members and types
- - Allocators (versions 3.0, 3.1, 3.2)
- - Allocators (version 3.3)
+ - Allocators (versions 3.0, 3.1, 3.2, 3.3)
+ - Allocators (version 3.4)
- Compile-time checks
- LWG Issues
- Demangling
diff --git a/libstdc++-v3/docs/html/ext/howto.html b/libstdc++-v3/docs/html/ext/howto.html
index 1fa80ad8f80..3289619625c 100644
--- a/libstdc++-v3/docs/html/ext/howto.html
+++ b/libstdc++-v3/docs/html/ext/howto.html
@@ -41,8 +41,8 @@
- Ropes and trees and hashes, oh my!
- Added members and types
- - Allocators (versions 3.0, 3.1, 3.2)
- - Allocators (version 3.3)
+ - Allocators (versions 3.0, 3.1, 3.2, 3.3)
+ - Allocators (version 3.4)
- Compile-time checks
- LWG Issues
- Demangling
@@ -134,7 +134,7 @@
-
+
Thread-safety, space efficiency, high speed, portability... this is a
mess. Where to begin?
@@ -361,9 +361,14 @@
-
+
Changes are coming...
+ If you plan on writing your own allocators,
+ source documentation is
+ available. You'll need to get the "maintainers" collection
+ in order to see the helper classes and extra notes.
+
Return to top of page or
to the FAQ.
diff --git a/libstdc++-v3/include/bits/basic_string.h b/libstdc++-v3/include/bits/basic_string.h
index b4658d640c2..968d4cae526 100644
--- a/libstdc++-v3/include/bits/basic_string.h
+++ b/libstdc++-v3/include/bits/basic_string.h
@@ -661,43 +661,43 @@ namespace std
// _S_construct_aux is used to implement the 21.3.1 para 15 which
// requires special behaviour if _InIter is an integral type
- template
+ template
static _CharT*
- _S_construct_aux(_InIter __beg, _InIter __end, const _Alloc& __a,
+ _S_construct_aux(_InIterator __beg, _InIterator __end, const _Alloc& __a,
__false_type)
{
- typedef typename iterator_traits<_InIter>::iterator_category _Tag;
+ typedef typename iterator_traits<_InIterator>::iterator_category _Tag;
return _S_construct(__beg, __end, __a, _Tag());
}
- template
+ template
static _CharT*
- _S_construct_aux(_InIter __beg, _InIter __end, const _Alloc& __a,
+ _S_construct_aux(_InIterator __beg, _InIterator __end, const _Alloc& __a,
__true_type)
{
return _S_construct(static_cast(__beg),
static_cast(__end), __a);
}
- template
+ template
static _CharT*
- _S_construct(_InIter __beg, _InIter __end, const _Alloc& __a)
+ _S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a)
{
- typedef typename _Is_integer<_InIter>::_Integral _Integral;
+ typedef typename _Is_integer<_InIterator>::_Integral _Integral;
return _S_construct_aux(__beg, __end, __a, _Integral());
}
// For Input Iterators, used in istreambuf_iterators, etc.
- template
+ template
static _CharT*
- _S_construct(_InIter __beg, _InIter __end, const _Alloc& __a,
+ _S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a,
input_iterator_tag);
// For forward_iterators up to random_access_iterators, used for
// string::iterator, _CharT*, etc.
- template
+ template
static _CharT*
- _S_construct(_FwdIter __beg, _FwdIter __end, const _Alloc& __a,
+ _S_construct(_FwdIterator __beg, _FwdIterator __end, const _Alloc& __a,
forward_iterator_tag);
static _CharT*
diff --git a/libstdc++-v3/include/bits/basic_string.tcc b/libstdc++-v3/include/bits/basic_string.tcc
index 9d2826dedc1..3855eff9882 100644
--- a/libstdc++-v3/include/bits/basic_string.tcc
+++ b/libstdc++-v3/include/bits/basic_string.tcc
@@ -71,10 +71,10 @@ namespace std
// Input Iterators have a cost structure very different from
// pointers, calling for a different coding style.
template
- template
+ template
_CharT*
basic_string<_CharT, _Traits, _Alloc>::
- _S_construct(_InIter __beg, _InIter __end, const _Alloc& __a,
+ _S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a,
input_iterator_tag)
{
if (__beg == __end && __a == _Alloc())
@@ -131,17 +131,17 @@ namespace std
}
template
- template
+ template
_CharT*
basic_string<_CharT, _Traits, _Alloc>::
- _S_construct(_InIter __beg, _InIter __end, const _Alloc& __a,
+ _S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a,
forward_iterator_tag)
{
if (__beg == __end && __a == _Alloc())
return _S_empty_rep()._M_refcopy();
// NB: Not required, but considered best practice.
- if (__builtin_expect(__beg == _InIter(), 0))
+ if (__builtin_expect(__beg == _InIterator(), 0))
__throw_logic_error("basic_string::_S_construct NULL not valid");
const size_type __dnew = static_cast(std::distance(__beg, __end));
@@ -234,9 +234,9 @@ namespace std
{ }
template
- template
+ template
basic_string<_CharT, _Traits, _Alloc>::
- basic_string(_InputIter __beg, _InputIter __end, const _Alloc& __a)
+ basic_string(_InputIterator __beg, _InputIterator __end, const _Alloc& __a)
: _M_dataplus(_S_construct(__beg, __end, __a), __a)
{ }
@@ -613,11 +613,11 @@ namespace std
// for input iterators and reverse iterators. It buffers internally and then
// calls _M_replace_safe.
template
- template
+ template
basic_string<_CharT, _Traits, _Alloc>&
basic_string<_CharT, _Traits, _Alloc>::
- _M_replace(iterator __i1, iterator __i2, _InputIter __k1,
- _InputIter __k2, input_iterator_tag)
+ _M_replace(iterator __i1, iterator __i2, _InputIterator __k1,
+ _InputIterator __k2, input_iterator_tag)
{
// Save concerned source string data in a temporary.
const basic_string __s(__k1, __k2);
@@ -628,11 +628,11 @@ namespace std
// and can be used in "safe" situations involving forward iterators,
// i.e., when source and destination ranges are known to not overlap.
template
- template
+ template
basic_string<_CharT, _Traits, _Alloc>&
basic_string<_CharT, _Traits, _Alloc>::
- _M_replace_safe(iterator __i1, iterator __i2, _ForwardIter __k1,
- _ForwardIter __k2)
+ _M_replace_safe(iterator __i1, iterator __i2, _ForwardIterator __k1,
+ _ForwardIterator __k2)
{
const size_type __dnew = static_cast(std::distance(__k1, __k2));
const size_type __dold = __i2 - __i1;
diff --git a/libstdc++-v3/include/bits/deque.tcc b/libstdc++-v3/include/bits/deque.tcc
index d4143f4f155..7e3b21efe04 100644
--- a/libstdc++-v3/include/bits/deque.tcc
+++ b/libstdc++-v3/include/bits/deque.tcc
@@ -186,10 +186,10 @@ namespace std
}
template
- template
+ template
void
deque<_Tp,_Alloc>
- ::_M_assign_aux(_InputIter __first, _InputIter __last, input_iterator_tag)
+ ::_M_assign_aux(_InputIterator __first, _InputIterator __last, input_iterator_tag)
{
iterator __cur = begin();
for ( ; __first != __last && __cur != end(); ++__cur, ++__first)
@@ -710,4 +710,3 @@ namespace std
} // namespace std
#endif /* __GLIBCPP_INTERNAL_DEQUE_TCC */
-
diff --git a/libstdc++-v3/include/bits/list.tcc b/libstdc++-v3/include/bits/list.tcc
index e4d47a2bb37..95a74273155 100644
--- a/libstdc++-v3/include/bits/list.tcc
+++ b/libstdc++-v3/include/bits/list.tcc
@@ -160,10 +160,10 @@ namespace std
}
template
- template
+ template
void
list<_Tp,_Alloc>::
- _M_assign_dispatch(_InputIter __first2, _InputIter __last2, __false_type)
+ _M_assign_dispatch(_InputIterator __first2, _InputIterator __last2, __false_type)
{
iterator __first1 = begin();
iterator __last1 = end();
diff --git a/libstdc++-v3/include/bits/stl_algo.h b/libstdc++-v3/include/bits/stl_algo.h
index ea5722ea7e7..ac15b3afcbf 100644
--- a/libstdc++-v3/include/bits/stl_algo.h
+++ b/libstdc++-v3/include/bits/stl_algo.h
@@ -147,12 +147,12 @@ namespace std
* @p [first,last). @p f must not modify the order of the sequence.
* If @p f has a return value it is ignored.
*/
- template
+ template
_Function
- for_each(_InputIter __first, _InputIter __last, _Function __f)
+ for_each(_InputIterator __first, _InputIterator __last, _Function __f)
{
// concept requirements
- __glibcpp_function_requires(_InputIteratorConcept<_InputIter>)
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIterator>)
for ( ; __first != __last; ++__first)
__f(*__first);
return __f;
@@ -163,9 +163,9 @@ namespace std
* This is an overload used by find() for the Input Iterator case.
* @endif
*/
- template
- inline _InputIter
- find(_InputIter __first, _InputIter __last,
+ template
+ inline _InputIterator
+ find(_InputIterator __first, _InputIterator __last,
const _Tp& __val,
input_iterator_tag)
{
@@ -179,9 +179,9 @@ namespace std
* This is an overload used by find_if() for the Input Iterator case.
* @endif
*/
- template
- inline _InputIter
- find_if(_InputIter __first, _InputIter __last,
+ template
+ inline _InputIterator
+ find_if(_InputIterator __first, _InputIterator __last,
_Predicate __pred,
input_iterator_tag)
{
@@ -195,13 +195,13 @@ namespace std
* This is an overload used by find() for the RAI case.
* @endif
*/
- template
- _RandomAccessIter
- find(_RandomAccessIter __first, _RandomAccessIter __last,
+ template
+ _RandomAccessIterator
+ find(_RandomAccessIterator __first, _RandomAccessIterator __last,
const _Tp& __val,
random_access_iterator_tag)
{
- typename iterator_traits<_RandomAccessIter>::difference_type __trip_count
+ typename iterator_traits<_RandomAccessIterator>::difference_type __trip_count
= (__last - __first) >> 2;
for ( ; __trip_count > 0 ; --__trip_count) {
@@ -239,13 +239,13 @@ namespace std
* This is an overload used by find_if() for the RAI case.
* @endif
*/
- template
- _RandomAccessIter
- find_if(_RandomAccessIter __first, _RandomAccessIter __last,
+ template
+ _RandomAccessIterator
+ find_if(_RandomAccessIterator __first, _RandomAccessIterator __last,
_Predicate __pred,
random_access_iterator_tag)
{
- typename iterator_traits<_RandomAccessIter>::difference_type __trip_count
+ typename iterator_traits<_RandomAccessIterator>::difference_type __trip_count
= (__last - __first) >> 2;
for ( ; __trip_count > 0 ; --__trip_count) {
@@ -286,15 +286,15 @@ namespace std
* @return The first iterator @c i in the range @p [first,last)
* such that @c *i == @p val, or @p last if no such iterator exists.
*/
- template
- inline _InputIter
- find(_InputIter __first, _InputIter __last,
+ template
+ inline _InputIterator
+ find(_InputIterator __first, _InputIterator __last,
const _Tp& __val)
{
// concept requirements
- __glibcpp_function_requires(_InputIteratorConcept<_InputIter>)
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIterator>)
__glibcpp_function_requires(_EqualOpConcept<
- typename iterator_traits<_InputIter>::value_type, _Tp>)
+ typename iterator_traits<_InputIterator>::value_type, _Tp>)
return find(__first, __last, __val, __iterator_category(__first));
}
@@ -306,15 +306,15 @@ namespace std
* @return The first iterator @c i in the range @p [first,last)
* such that @p pred(*i) is true, or @p last if no such iterator exists.
*/
- template
- inline _InputIter
- find_if(_InputIter __first, _InputIter __last,
+ template
+ inline _InputIterator
+ find_if(_InputIterator __first, _InputIterator __last,
_Predicate __pred)
{
// concept requirements
- __glibcpp_function_requires(_InputIteratorConcept<_InputIter>)
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIterator>)
__glibcpp_function_requires(_UnaryPredicateConcept<_Predicate,
- typename iterator_traits<_InputIter>::value_type>)
+ typename iterator_traits<_InputIterator>::value_type>)
return find_if(__first, __last, __pred, __iterator_category(__first));
}
@@ -326,17 +326,17 @@ namespace std
* valid iterators in @p [first,last) and such that @c *i == @c *(i+1),
* or @p last if no such iterator exists.
*/
- template
- _ForwardIter
- adjacent_find(_ForwardIter __first, _ForwardIter __last)
+ template
+ _ForwardIterator
+ adjacent_find(_ForwardIterator __first, _ForwardIterator __last)
{
// concept requirements
- __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>)
+ __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
__glibcpp_function_requires(_EqualityComparableConcept<
- typename iterator_traits<_ForwardIter>::value_type>)
+ typename iterator_traits<_ForwardIterator>::value_type>)
if (__first == __last)
return __last;
- _ForwardIter __next = __first;
+ _ForwardIterator __next = __first;
while(++__next != __last) {
if (*__first == *__next)
return __first;
@@ -355,19 +355,19 @@ namespace std
* @p binary_pred(*i,*(i+1)) is true, or @p last if no such iterator
* exists.
*/
- template
- _ForwardIter
- adjacent_find(_ForwardIter __first, _ForwardIter __last,
+ template
+ _ForwardIterator
+ adjacent_find(_ForwardIterator __first, _ForwardIterator __last,
_BinaryPredicate __binary_pred)
{
// concept requirements
- __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>)
+ __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
__glibcpp_function_requires(_BinaryPredicateConcept<_BinaryPredicate,
- typename iterator_traits<_ForwardIter>::value_type,
- typename iterator_traits<_ForwardIter>::value_type>)
+ typename iterator_traits<_ForwardIterator>::value_type,
+ typename iterator_traits<_ForwardIterator>::value_type>)
if (__first == __last)
return __last;
- _ForwardIter __next = __first;
+ _ForwardIterator __next = __first;
while(++__next != __last) {
if (__binary_pred(*__first, *__next))
return __first;
@@ -384,16 +384,16 @@ namespace std
* @return The number of iterators @c i in the range @p [first,last)
* for which @c *i == @p value
*/
- template
- typename iterator_traits<_InputIter>::difference_type
- count(_InputIter __first, _InputIter __last, const _Tp& __value)
+ template
+ typename iterator_traits<_InputIterator>::difference_type
+ count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
{
// concept requirements
- __glibcpp_function_requires(_InputIteratorConcept<_InputIter>)
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIterator>)
__glibcpp_function_requires(_EqualityComparableConcept<
- typename iterator_traits<_InputIter>::value_type >)
+ typename iterator_traits<_InputIterator>::value_type >)
__glibcpp_function_requires(_EqualityComparableConcept<_Tp>)
- typename iterator_traits<_InputIter>::difference_type __n = 0;
+ typename iterator_traits<_InputIterator>::difference_type __n = 0;
for ( ; __first != __last; ++__first)
if (*__first == __value)
++__n;
@@ -408,15 +408,15 @@ namespace std
* @return The number of iterators @c i in the range @p [first,last)
* for which @p pred(*i) is true.
*/
- template
- typename iterator_traits<_InputIter>::difference_type
- count_if(_InputIter __first, _InputIter __last, _Predicate __pred)
+ template
+ typename iterator_traits<_InputIterator>::difference_type
+ count_if(_InputIterator __first, _InputIterator __last, _Predicate __pred)
{
// concept requirements
- __glibcpp_function_requires(_InputIteratorConcept<_InputIter>)
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIterator>)
__glibcpp_function_requires(_UnaryPredicateConcept<_Predicate,
- typename iterator_traits<_InputIter>::value_type>)
- typename iterator_traits<_InputIter>::difference_type __n = 0;
+ typename iterator_traits<_InputIterator>::value_type>)
+ typename iterator_traits<_InputIterator>::difference_type __n = 0;
for ( ; __first != __last; ++__first)
if (__pred(*__first))
++__n;
@@ -447,35 +447,35 @@ namespace std
* This means that the returned iterator @c i will be in the range
* @p [first1,last1-(last2-first2))
*/
- template
- _ForwardIter1
- search(_ForwardIter1 __first1, _ForwardIter1 __last1,
- _ForwardIter2 __first2, _ForwardIter2 __last2)
+ template
+ _ForwardIterator1
+ search(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
+ _ForwardIterator2 __first2, _ForwardIterator2 __last2)
{
// concept requirements
- __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter1>)
- __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter2>)
+ __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIterator1>)
+ __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIterator2>)
__glibcpp_function_requires(_EqualOpConcept<
- typename iterator_traits<_ForwardIter1>::value_type,
- typename iterator_traits<_ForwardIter2>::value_type>)
+ typename iterator_traits<_ForwardIterator1>::value_type,
+ typename iterator_traits<_ForwardIterator2>::value_type>)
// Test for empty ranges
if (__first1 == __last1 || __first2 == __last2)
return __first1;
// Test for a pattern of length 1.
- _ForwardIter2 __tmp(__first2);
+ _ForwardIterator2 __tmp(__first2);
++__tmp;
if (__tmp == __last2)
return find(__first1, __last1, *__first2);
// General case.
- _ForwardIter2 __p1, __p;
+ _ForwardIterator2 __p1, __p;
__p1 = __first2; ++__p1;
- _ForwardIter1 __current = __first1;
+ _ForwardIterator1 __current = __first1;
while (__first1 != __last1) {
__first1 = find(__first1, __last1, *__first2);
@@ -519,25 +519,25 @@ namespace std
*
* @see search(_ForwardIter1, _ForwardIter1, _ForwardIter2, _ForwardIter2)
*/
- template
- _ForwardIter1
- search(_ForwardIter1 __first1, _ForwardIter1 __last1,
- _ForwardIter2 __first2, _ForwardIter2 __last2,
- _BinaryPred __predicate)
+ template
+ _ForwardIterator1
+ search(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
+ _ForwardIterator2 __first2, _ForwardIterator2 __last2,
+ _BinaryPredicate __predicate)
{
// concept requirements
- __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter1>)
- __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter2>)
- __glibcpp_function_requires(_BinaryPredicateConcept<_BinaryPred,
- typename iterator_traits<_ForwardIter1>::value_type,
- typename iterator_traits<_ForwardIter2>::value_type>)
+ __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIterator1>)
+ __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIterator2>)
+ __glibcpp_function_requires(_BinaryPredicateConcept<_BinaryPredicate,
+ typename iterator_traits<_ForwardIterator1>::value_type,
+ typename iterator_traits<_ForwardIterator2>::value_type>)
// Test for empty ranges
if (__first1 == __last1 || __first2 == __last2)
return __first1;
// Test for a pattern of length 1.
- _ForwardIter2 __tmp(__first2);
+ _ForwardIterator2 __tmp(__first2);
++__tmp;
if (__tmp == __last2) {
while (__first1 != __last1 && !__predicate(*__first1, *__first2))
@@ -547,11 +547,11 @@ namespace std
// General case.
- _ForwardIter2 __p1, __p;
+ _ForwardIterator2 __p1, __p;
__p1 = __first2; ++__p1;
- _ForwardIter1 __current = __first1;
+ _ForwardIterator1 __current = __first1;
while (__first1 != __last1) {
while (__first1 != __last1) {
@@ -593,15 +593,15 @@ namespace std
* Searches the range @p [first,last) for @p count consecutive elements
* equal to @p val.
*/
- template
- _ForwardIter
- search_n(_ForwardIter __first, _ForwardIter __last,
+ template
+ _ForwardIterator
+ search_n(_ForwardIterator __first, _ForwardIterator __last,
_Integer __count, const _Tp& __val)
{
// concept requirements
- __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>)
+ __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
__glibcpp_function_requires(_EqualityComparableConcept<
- typename iterator_traits<_ForwardIter>::value_type>)
+ typename iterator_traits<_ForwardIterator>::value_type>)
__glibcpp_function_requires(_EqualityComparableConcept<_Tp>)
if (__count <= 0)
@@ -610,7 +610,7 @@ namespace std
__first = find(__first, __last, __val);
while (__first != __last) {
_Integer __n = __count - 1;
- _ForwardIter __i = __first;
+ _ForwardIterator __i = __first;
++__i;
while (__i != __last && __n != 0 && *__i == __val) {
++__i;
@@ -640,17 +640,17 @@ namespace std
* Searches the range @p [first,last) for @p count consecutive elements
* for which the predicate returns true.
*/
- template
- _ForwardIter
- search_n(_ForwardIter __first, _ForwardIter __last,
+ template
+ _ForwardIterator
+ search_n(_ForwardIterator __first, _ForwardIterator __last,
_Integer __count, const _Tp& __val,
- _BinaryPred __binary_pred)
+ _BinaryPredicate __binary_pred)
{
// concept requirements
- __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>)
- __glibcpp_function_requires(_BinaryPredicateConcept<_BinaryPred,
- typename iterator_traits<_ForwardIter>::value_type, _Tp>)
+ __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcpp_function_requires(_BinaryPredicateConcept<_BinaryPredicate,
+ typename iterator_traits<_ForwardIterator>::value_type, _Tp>)
if (__count <= 0)
return __first;
@@ -662,7 +662,7 @@ namespace std
}
while (__first != __last) {
_Integer __n = __count - 1;
- _ForwardIter __i = __first;
+ _ForwardIterator __i = __first;
++__i;
while (__i != __last && __n != 0 && __binary_pred(*__i, __val)) {
++__i;
@@ -694,20 +694,20 @@ namespace std
* corresponding element in the range @p [first2,(last1-first1)).
* The ranges must not overlap.
*/
- template
- _ForwardIter2
- swap_ranges(_ForwardIter1 __first1, _ForwardIter1 __last1,
- _ForwardIter2 __first2)
+ template
+ _ForwardIterator2
+ swap_ranges(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
+ _ForwardIterator2 __first2)
{
// concept requirements
- __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter1>)
- __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter2>)
+ __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIterator1>)
+ __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIterator2>)
__glibcpp_function_requires(_ConvertibleConcept<
- typename iterator_traits<_ForwardIter1>::value_type,
- typename iterator_traits<_ForwardIter2>::value_type>)
+ typename iterator_traits<_ForwardIterator1>::value_type,
+ typename iterator_traits<_ForwardIterator2>::value_type>)
__glibcpp_function_requires(_ConvertibleConcept<
- typename iterator_traits<_ForwardIter2>::value_type,
- typename iterator_traits<_ForwardIter1>::value_type>)
+ typename iterator_traits<_ForwardIterator2>::value_type,
+ typename iterator_traits<_ForwardIterator1>::value_type>)
for ( ; __first1 != __last1; ++__first1, ++__first2)
iter_swap(__first1, __first2);
@@ -729,14 +729,14 @@ namespace std
*
* @p unary_op must not alter its argument.
*/
- template
- _OutputIter
- transform(_InputIter __first, _InputIter __last,
- _OutputIter __result, _UnaryOperation __unary_op)
+ template
+ _OutputIterator
+ transform(_InputIterator __first, _InputIterator __last,
+ _OutputIterator __result, _UnaryOperation __unary_op)
{
// concept requirements
- __glibcpp_function_requires(_InputIteratorConcept<_InputIter>)
- __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcpp_function_requires(_OutputIteratorConcept<_OutputIterator,
// "the type returned by a _UnaryOperation"
__typeof__(__unary_op(*__first))>)
@@ -762,17 +762,17 @@ namespace std
*
* @p binary_op must not alter either of its arguments.
*/
- template
- _OutputIter
- transform(_InputIter1 __first1, _InputIter1 __last1,
- _InputIter2 __first2, _OutputIter __result,
+ _OutputIterator
+ transform(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _OutputIterator __result,
_BinaryOperation __binary_op)
{
// concept requirements
- __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>)
- __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>)
- __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIterator1>)
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIterator2>)
+ __glibcpp_function_requires(_OutputIteratorConcept<_OutputIterator,
// "the type returned by a _BinaryOperation"
__typeof__(__binary_op(*__first1,*__first2))>)
@@ -793,17 +793,17 @@ namespace std
* For each iterator @c i in the range @p [first,last) if @c *i ==
* @p old_value then the assignment @c *i = @p new_value is performed.
*/
- template
+ template
void
- replace(_ForwardIter __first, _ForwardIter __last,
+ replace(_ForwardIterator __first, _ForwardIterator __last,
const _Tp& __old_value, const _Tp& __new_value)
{
// concept requirements
- __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter>)
+ __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIterator>)
__glibcpp_function_requires(_EqualOpConcept<
- typename iterator_traits<_ForwardIter>::value_type, _Tp>)
+ typename iterator_traits<_ForwardIterator>::value_type, _Tp>)
__glibcpp_function_requires(_ConvertibleConcept<_Tp,
- typename iterator_traits<_ForwardIter>::value_type>)
+ typename iterator_traits<_ForwardIterator>::value_type>)
for ( ; __first != __last; ++__first)
if (*__first == __old_value)
@@ -822,17 +822,17 @@ namespace std
* For each iterator @c i in the range @p [first,last) if @p pred(*i)
* is true then the assignment @c *i = @p new_value is performed.
*/
- template
+ template
void
- replace_if(_ForwardIter __first, _ForwardIter __last,
+ replace_if(_ForwardIterator __first, _ForwardIterator __last,
_Predicate __pred, const _Tp& __new_value)
{
// concept requirements
- __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter>)
+ __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIterator>)
__glibcpp_function_requires(_ConvertibleConcept<_Tp,
- typename iterator_traits<_ForwardIter>::value_type>)
+ typename iterator_traits<_ForwardIterator>::value_type>)
__glibcpp_function_requires(_UnaryPredicateConcept<_Predicate,
- typename iterator_traits<_ForwardIter>::value_type>)
+ typename iterator_traits<_ForwardIterator>::value_type>)
for ( ; __first != __last; ++__first)
if (__pred(*__first))
@@ -853,18 +853,18 @@ namespace std
* output range @p [result,result+(last-first)) replacing elements
* equal to @p old_value with @p new_value.
*/
- template
- _OutputIter
- replace_copy(_InputIter __first, _InputIter __last,
- _OutputIter __result,
+ template
+ _OutputIterator
+ replace_copy(_InputIterator __first, _InputIterator __last,
+ _OutputIterator __result,
const _Tp& __old_value, const _Tp& __new_value)
{
// concept requirements
- __glibcpp_function_requires(_InputIteratorConcept<_InputIter>)
- __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
- typename iterator_traits<_InputIter>::value_type>)
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcpp_function_requires(_OutputIteratorConcept<_OutputIterator,
+ typename iterator_traits<_InputIterator>::value_type>)
__glibcpp_function_requires(_EqualOpConcept<
- typename iterator_traits<_InputIter>::value_type, _Tp>)
+ typename iterator_traits<_InputIterator>::value_type, _Tp>)
for ( ; __first != __last; ++__first, ++__result)
*__result = *__first == __old_value ? __new_value : *__first;
@@ -885,19 +885,19 @@ namespace std
* @p [result,result+(last-first)) replacing elements for which
* @p pred returns true with @p new_value.
*/
- template
- _OutputIter
- replace_copy_if(_InputIter __first, _InputIter __last,
- _OutputIter __result,
+ _OutputIterator
+ replace_copy_if(_InputIterator __first, _InputIterator __last,
+ _OutputIterator __result,
_Predicate __pred, const _Tp& __new_value)
{
// concept requirements
- __glibcpp_function_requires(_InputIteratorConcept<_InputIter>)
- __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
- typename iterator_traits<_InputIter>::value_type>)
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcpp_function_requires(_OutputIteratorConcept<_OutputIterator,
+ typename iterator_traits<_InputIterator>::value_type>)
__glibcpp_function_requires(_UnaryPredicateConcept<_Predicate,
- typename iterator_traits<_InputIter>::value_type>)
+ typename iterator_traits<_InputIterator>::value_type>)
for ( ; __first != __last; ++__first, ++__result)
*__result = __pred(*__first) ? __new_value : *__first;
@@ -915,14 +915,14 @@ namespace std
* Performs the assignment @c *i = @p gen() for each @c i in the range
* @p [first,last).
*/
- template
+ template
void
- generate(_ForwardIter __first, _ForwardIter __last, _Generator __gen)
+ generate(_ForwardIterator __first, _ForwardIterator __last, _Generator __gen)
{
// concept requirements
- __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>)
+ __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
__glibcpp_function_requires(_GeneratorConcept<_Generator,
- typename iterator_traits<_ForwardIter>::value_type>)
+ typename iterator_traits<_ForwardIterator>::value_type>)
for ( ; __first != __last; ++__first)
*__first = __gen();
@@ -939,12 +939,12 @@ namespace std
* Performs the assignment @c *i = @p gen() for each @c i in the range
* @p [first,first+n).
*/
- template
- _OutputIter
- generate_n(_OutputIter __first, _Size __n, _Generator __gen)
+ template
+ _OutputIterator
+ generate_n(_OutputIterator __first, _Size __n, _Generator __gen)
{
// concept requirements
- __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
+ __glibcpp_function_requires(_OutputIteratorConcept<_OutputIterator,
// "the type returned by a _Generator"
__typeof__(gen())>)
@@ -966,17 +966,17 @@ namespace std
* remove_copy() is stable, so the relative order of elements that are
* copied is unchanged.
*/
- template
- _OutputIter
- remove_copy(_InputIter __first, _InputIter __last,
- _OutputIter __result, const _Tp& __value)
+ template
+ _OutputIterator
+ remove_copy(_InputIterator __first, _InputIterator __last,
+ _OutputIterator __result, const _Tp& __value)
{
// concept requirements
- __glibcpp_function_requires(_InputIteratorConcept<_InputIter>)
- __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
- typename iterator_traits<_InputIter>::value_type>)
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcpp_function_requires(_OutputIteratorConcept<_OutputIterator,
+ typename iterator_traits<_InputIterator>::value_type>)
__glibcpp_function_requires(_EqualOpConcept<
- typename iterator_traits<_InputIter>::value_type, _Tp>)
+ typename iterator_traits<_InputIterator>::value_type, _Tp>)
for ( ; __first != __last; ++__first)
if (!(*__first == __value)) {
@@ -1000,17 +1000,17 @@ namespace std
* remove_copy_if() is stable, so the relative order of elements that are
* copied is unchanged.
*/
- template
- _OutputIter
- remove_copy_if(_InputIter __first, _InputIter __last,
- _OutputIter __result, _Predicate __pred)
+ template
+ _OutputIterator
+ remove_copy_if(_InputIterator __first, _InputIterator __last,
+ _OutputIterator __result, _Predicate __pred)
{
// concept requirements
- __glibcpp_function_requires(_InputIteratorConcept<_InputIter>)
- __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
- typename iterator_traits<_InputIter>::value_type>)
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcpp_function_requires(_OutputIteratorConcept<_OutputIterator,
+ typename iterator_traits<_InputIterator>::value_type>)
__glibcpp_function_requires(_UnaryPredicateConcept<_Predicate,
- typename iterator_traits<_InputIter>::value_type>)
+ typename iterator_traits<_InputIterator>::value_type>)
for ( ; __first != __last; ++__first)
if (!__pred(*__first)) {
@@ -1036,20 +1036,20 @@ namespace std
* Elements between the end of the resulting sequence and @p last
* are still present, but their value is unspecified.
*/
- template
- _ForwardIter
- remove(_ForwardIter __first, _ForwardIter __last,
+ template
+ _ForwardIterator
+ remove(_ForwardIterator __first, _ForwardIterator __last,
const _Tp& __value)
{
// concept requirements
- __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter>)
+ __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIterator>)
__glibcpp_function_requires(_ConvertibleConcept<_Tp,
- typename iterator_traits<_ForwardIter>::value_type>)
+ typename iterator_traits<_ForwardIterator>::value_type>)
__glibcpp_function_requires(_EqualOpConcept<
- typename iterator_traits<_ForwardIter>::value_type, _Tp>)
+ typename iterator_traits<_ForwardIterator>::value_type, _Tp>)
__first = find(__first, __last, __value);
- _ForwardIter __i = __first;
+ _ForwardIterator __i = __first;
return __first == __last ? __first
: remove_copy(++__i, __last, __first, __value);
}
@@ -1070,36 +1070,36 @@ namespace std
* Elements between the end of the resulting sequence and @p last
* are still present, but their value is unspecified.
*/
- template
- _ForwardIter
- remove_if(_ForwardIter __first, _ForwardIter __last,
+ template
+ _ForwardIterator
+ remove_if(_ForwardIterator __first, _ForwardIterator __last,
_Predicate __pred)
{
// concept requirements
- __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter>)
+ __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIterator>)
__glibcpp_function_requires(_UnaryPredicateConcept<_Predicate,
- typename iterator_traits<_ForwardIter>::value_type>)
+ typename iterator_traits<_ForwardIterator>::value_type>)
__first = find_if(__first, __last, __pred);
- _ForwardIter __i = __first;
+ _ForwardIterator __i = __first;
return __first == __last ? __first
: remove_copy_if(++__i, __last, __first, __pred);
}
/**
* @if maint
- * This is an uglified unique_copy(_InputIter, _InputIter, _OutputIter)
+ * This is an uglified unique_copy(_InputIterator, _InputIterator, _OutputIterator)
* overloaded for output iterators.
* @endif
*/
- template
- _OutputIter
- __unique_copy(_InputIter __first, _InputIter __last,
- _OutputIter __result,
+ template
+ _OutputIterator
+ __unique_copy(_InputIterator __first, _InputIterator __last,
+ _OutputIterator __result,
output_iterator_tag)
{
// concept requirements -- taken care of in dispatching function
- typename iterator_traits<_InputIter>::value_type __value = *__first;
+ typename iterator_traits<_InputIterator>::value_type __value = *__first;
*__result = __value;
while (++__first != __last)
if (!(__value == *__first)) {
@@ -1111,14 +1111,14 @@ namespace std
/**
* @if maint
- * This is an uglified unique_copy(_InputIter, _InputIter, _OutputIter)
+ * This is an uglified unique_copy(_InputIterator, _InputIterator, _OutputIterator)
* overloaded for forward iterators.
* @endif
*/
- template
- _ForwardIter
- __unique_copy(_InputIter __first, _InputIter __last,
- _ForwardIter __result,
+ template
+ _ForwardIterator
+ __unique_copy(_InputIterator __first, _InputIterator __last,
+ _ForwardIterator __result,
forward_iterator_tag)
{
// concept requirements -- taken care of in dispatching function
@@ -1142,19 +1142,19 @@ namespace std
* unique_copy() is stable, so the relative order of elements that are
* copied is unchanged.
*/
- template
- inline _OutputIter
- unique_copy(_InputIter __first, _InputIter __last,
- _OutputIter __result)
+ template
+ inline _OutputIterator
+ unique_copy(_InputIterator __first, _InputIterator __last,
+ _OutputIterator __result)
{
// concept requirements
- __glibcpp_function_requires(_InputIteratorConcept<_InputIter>)
- __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
- typename iterator_traits<_InputIter>::value_type>)
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcpp_function_requires(_OutputIteratorConcept<_OutputIterator,
+ typename iterator_traits<_InputIterator>::value_type>)
__glibcpp_function_requires(_EqualityComparableConcept<
- typename iterator_traits<_InputIter>::value_type>)
+ typename iterator_traits<_InputIterator>::value_type>)
- typedef typename iterator_traits<_OutputIter>::iterator_category _IterType;
+ typedef typename iterator_traits<_OutputIterator>::iterator_category _IterType;
if (__first == __last) return __result;
return __unique_copy(__first, __last, __result, _IterType());
@@ -1163,23 +1163,23 @@ namespace std
/**
* @if maint
* This is an uglified
- * unique_copy(_InputIter, _InputIter, _OutputIter, _BinaryPredicate)
+ * unique_copy(_InputIterator, _InputIterator, _OutputIterator, _BinaryPredicate)
* overloaded for output iterators.
* @endif
*/
- template
- _OutputIter
- __unique_copy(_InputIter __first, _InputIter __last,
- _OutputIter __result,
+ template
+ _OutputIterator
+ __unique_copy(_InputIterator __first, _InputIterator __last,
+ _OutputIterator __result,
_BinaryPredicate __binary_pred,
output_iterator_tag)
{
// concept requirements -- iterators already checked
__glibcpp_function_requires(_BinaryPredicateConcept<_BinaryPredicate,
- typename iterator_traits<_InputIter>::value_type,
- typename iterator_traits<_InputIter>::value_type>)
+ typename iterator_traits<_InputIterator>::value_type,
+ typename iterator_traits<_InputIterator>::value_type>)
- typename iterator_traits<_InputIter>::value_type __value = *__first;
+ typename iterator_traits<_InputIterator>::value_type __value = *__first;
*__result = __value;
while (++__first != __last)
if (!__binary_pred(__value, *__first)) {
@@ -1192,21 +1192,21 @@ namespace std
/**
* @if maint
* This is an uglified
- * unique_copy(_InputIter, _InputIter, _OutputIter, _BinaryPredicate)
+ * unique_copy(_InputIterator, _InputIterator, _OutputIterator, _BinaryPredicate)
* overloaded for forward iterators.
* @endif
*/
- template
- _ForwardIter
- __unique_copy(_InputIter __first, _InputIter __last,
- _ForwardIter __result,
+ template
+ _ForwardIterator
+ __unique_copy(_InputIterator __first, _InputIterator __last,
+ _ForwardIterator __result,
_BinaryPredicate __binary_pred,
forward_iterator_tag)
{
// concept requirements -- iterators already checked
__glibcpp_function_requires(_BinaryPredicateConcept<_BinaryPredicate,
- typename iterator_traits<_ForwardIter>::value_type,
- typename iterator_traits<_InputIter>::value_type>)
+ typename iterator_traits<_ForwardIterator>::value_type,
+ typename iterator_traits<_InputIterator>::value_type>)
*__result = *__first;
while (++__first != __last)
@@ -1229,18 +1229,18 @@ namespace std
* unique_copy() is stable, so the relative order of elements that are
* copied is unchanged.
*/
- template
- inline _OutputIter
- unique_copy(_InputIter __first, _InputIter __last,
- _OutputIter __result,
+ template
+ inline _OutputIterator
+ unique_copy(_InputIterator __first, _InputIterator __last,
+ _OutputIterator __result,
_BinaryPredicate __binary_pred)
{
// concept requirements -- predicates checked later
- __glibcpp_function_requires(_InputIteratorConcept<_InputIter>)
- __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
- typename iterator_traits<_InputIter>::value_type>)
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcpp_function_requires(_OutputIteratorConcept<_OutputIterator,
+ typename iterator_traits<_InputIterator>::value_type>)
- typedef typename iterator_traits<_OutputIter>::iterator_category _IterType;
+ typedef typename iterator_traits<_OutputIterator>::iterator_category _IterType;
if (__first == __last) return __result;
return __unique_copy(__first, __last,
@@ -1260,14 +1260,14 @@ __result, __binary_pred, _IterType());
* Elements between the end of the resulting sequence and @p last
* are still present, but their value is unspecified.
*/
- template
- _ForwardIter
- unique(_ForwardIter __first, _ForwardIter __last)
+ template
+ _ForwardIterator
+ unique(_ForwardIterator __first, _ForwardIterator __last)
{
// concept requirements
- __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter>)
+ __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIterator>)
__glibcpp_function_requires(_EqualityComparableConcept<
- typename iterator_traits<_ForwardIter>::value_type>)
+ typename iterator_traits<_ForwardIterator>::value_type>)
__first = adjacent_find(__first, __last);
return unique_copy(__first, __last, __first);
@@ -1287,16 +1287,16 @@ __result, __binary_pred, _IterType());
* Elements between the end of the resulting sequence and @p last
* are still present, but their value is unspecified.
*/
- template
- _ForwardIter
- unique(_ForwardIter __first, _ForwardIter __last,
+ template
+ _ForwardIterator
+ unique(_ForwardIterator __first, _ForwardIterator __last,
_BinaryPredicate __binary_pred)
{
// concept requirements
- __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter>)
+ __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIterator>)
__glibcpp_function_requires(_BinaryPredicateConcept<_BinaryPredicate,
- typename iterator_traits<_ForwardIter>::value_type,
- typename iterator_traits<_ForwardIter>::value_type>)
+ typename iterator_traits<_ForwardIterator>::value_type,
+ typename iterator_traits<_ForwardIterator>::value_type>)
__first = adjacent_find(__first, __last, __binary_pred);
return unique_copy(__first, __last, __first, __binary_pred);
@@ -1304,13 +1304,13 @@ __result, __binary_pred, _IterType());
/**
* @if maint
- * This is an uglified reverse(_BidirectionalIter, _BidirectionalIter)
+ * This is an uglified reverse(_BidirectionalIterator, _BidirectionalIterator)
* overloaded for bidirectional iterators.
* @endif
*/
- template
+ template
void
- __reverse(_BidirectionalIter __first, _BidirectionalIter __last,
+ __reverse(_BidirectionalIterator __first, _BidirectionalIterator __last,
bidirectional_iterator_tag)
{
while (true)
@@ -1322,13 +1322,13 @@ __result, __binary_pred, _IterType());
/**
* @if maint
- * This is an uglified reverse(_BidirectionalIter, _BidirectionalIter)
+ * This is an uglified reverse(_BidirectionalIterator, _BidirectionalIterator)
* overloaded for bidirectional iterators.
* @endif
*/
- template
+ template
void
- __reverse(_RandomAccessIter __first, _RandomAccessIter __last,
+ __reverse(_RandomAccessIterator __first, _RandomAccessIterator __last,
random_access_iterator_tag)
{
while (__first < __last)
@@ -1346,13 +1346,13 @@ __result, __binary_pred, _IterType());
* For every @c i such that @p 0<=i<=(last-first)/2), @p reverse()
* swaps @p *(first+i) and @p *(last-(i+1))
*/
- template
+ template
inline void
- reverse(_BidirectionalIter __first, _BidirectionalIter __last)
+ reverse(_BidirectionalIterator __first, _BidirectionalIterator __last)
{
// concept requirements
__glibcpp_function_requires(_Mutable_BidirectionalIteratorConcept<
- _BidirectionalIter>)
+ _BidirectionalIterator>)
__reverse(__first, __last, __iterator_category(__first));
}
@@ -1371,15 +1371,15 @@ __result, __binary_pred, _IterType());
* The ranges @p [first,last) and @p [result,result+(last-first))
* must not overlap.
*/
- template
- _OutputIter
- reverse_copy(_BidirectionalIter __first, _BidirectionalIter __last,
- _OutputIter __result)
+ template
+ _OutputIterator
+ reverse_copy(_BidirectionalIterator __first, _BidirectionalIterator __last,
+ _OutputIterator __result)
{
// concept requirements
- __glibcpp_function_requires(_BidirectionalIteratorConcept<_BidirectionalIter>)
- __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
- typename iterator_traits<_BidirectionalIter>::value_type>)
+ __glibcpp_function_requires(_BidirectionalIteratorConcept<_BidirectionalIterator>)
+ __glibcpp_function_requires(_OutputIteratorConcept<_OutputIterator,
+ typename iterator_traits<_BidirectionalIterator>::value_type>)
while (__first != __last) {
--__last;
@@ -1413,17 +1413,17 @@ __result, __binary_pred, _IterType());
* This is a helper function for the rotate algorithm.
* @endif
*/
- template
+ template
void
- __rotate(_ForwardIter __first,
- _ForwardIter __middle,
- _ForwardIter __last,
+ __rotate(_ForwardIterator __first,
+ _ForwardIterator __middle,
+ _ForwardIterator __last,
forward_iterator_tag)
{
if ((__first == __middle) || (__last == __middle))
return;
- _ForwardIter __first2 = __middle;
+ _ForwardIterator __first2 = __middle;
do {
swap(*__first++, *__first2++);
if (__first == __middle)
@@ -1446,16 +1446,16 @@ __result, __binary_pred, _IterType());
* This is a helper function for the rotate algorithm.
* @endif
*/
- template
+ template
void
- __rotate(_BidirectionalIter __first,
- _BidirectionalIter __middle,
- _BidirectionalIter __last,
+ __rotate(_BidirectionalIterator __first,
+ _BidirectionalIterator __middle,
+ _BidirectionalIterator __last,
bidirectional_iterator_tag)
{
// concept requirements
__glibcpp_function_requires(_Mutable_BidirectionalIteratorConcept<
- _BidirectionalIter>)
+ _BidirectionalIterator>)
if ((__first == __middle) || (__last == __middle))
return;
@@ -1479,22 +1479,22 @@ __result, __binary_pred, _IterType());
* This is a helper function for the rotate algorithm.
* @endif
*/
- template
+ template
void
- __rotate(_RandomAccessIter __first,
- _RandomAccessIter __middle,
- _RandomAccessIter __last,
+ __rotate(_RandomAccessIterator __first,
+ _RandomAccessIterator __middle,
+ _RandomAccessIterator __last,
random_access_iterator_tag)
{
// concept requirements
__glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<
- _RandomAccessIter>)
+ _RandomAccessIterator>)
if ((__first == __middle) || (__last == __middle))
return;
- typedef typename iterator_traits<_RandomAccessIter>::difference_type _Distance;
- typedef typename iterator_traits<_RandomAccessIter>::value_type _ValueType;
+ typedef typename iterator_traits<_RandomAccessIterator>::difference_type _Distance;
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type _ValueType;
_Distance __n = __last - __first;
_Distance __k = __middle - __first;
@@ -1509,7 +1509,7 @@ __result, __binary_pred, _IterType());
for (_Distance __i = 0; __i < __d; __i++) {
_ValueType __tmp = *__first;
- _RandomAccessIter __p = __first;
+ _RandomAccessIterator __p = __first;
if (__k < __l) {
for (_Distance __j = 0; __j < __l/__d; __j++) {
@@ -1558,14 +1558,14 @@ __result, __binary_pred, _IterType());
* Performs @p *(first+(n+(last-middle))%(last-first))=*(first+n) for
* each @p n in the range @p [0,last-first).
*/
- template
+ template
inline void
- rotate(_ForwardIter __first, _ForwardIter __middle, _ForwardIter __last)
+ rotate(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last)
{
// concept requirements
- __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter>)
+ __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIterator>)
- typedef typename iterator_traits<_ForwardIter>::iterator_category _IterType;
+ typedef typename iterator_traits<_ForwardIterator>::iterator_category _IterType;
__rotate(__first, __middle, __last, _IterType());
}
@@ -1586,15 +1586,15 @@ __result, __binary_pred, _IterType());
* Performs @p *(result+(n+(last-middle))%(last-first))=*(first+n) for
* each @p n in the range @p [0,last-first).
*/
- template
- _OutputIter
- rotate_copy(_ForwardIter __first, _ForwardIter __middle,
- _ForwardIter __last, _OutputIter __result)
+ template
+ _OutputIterator
+ rotate_copy(_ForwardIterator __first, _ForwardIterator __middle,
+ _ForwardIterator __last, _OutputIterator __result)
{
// concept requirements
- __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>)
- __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
- typename iterator_traits<_ForwardIter>::value_type>)
+ __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcpp_function_requires(_OutputIteratorConcept<_OutputIterator,
+ typename iterator_traits<_ForwardIterator>::value_type>)
return copy(__first, __middle, copy(__middle, __last, __result));
}
@@ -1631,16 +1631,16 @@ __result, __binary_pred, _IterType());
* distribution, so that every possible ordering of the sequence is
* equally likely.
*/
- template
+ template
inline void
- random_shuffle(_RandomAccessIter __first, _RandomAccessIter __last)
+ random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last)
{
// concept requirements
__glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<
- _RandomAccessIter>)
+ _RandomAccessIterator>)
if (__first == __last) return;
- for (_RandomAccessIter __i = __first + 1; __i != __last; ++__i)
+ for (_RandomAccessIterator __i = __first + 1; __i != __last; ++__i)
iter_swap(__i, __first + __random_number((__i - __first) + 1));
}
@@ -1657,17 +1657,17 @@ __result, __binary_pred, _IterType());
* integer @p N should return a randomly chosen integer from the
* range [0,N).
*/
- template
+ template
void
- random_shuffle(_RandomAccessIter __first, _RandomAccessIter __last,
+ random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last,
_RandomNumberGenerator& __rand)
{
// concept requirements
__glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<
- _RandomAccessIter>)
+ _RandomAccessIterator>)
if (__first == __last) return;
- for (_RandomAccessIter __i = __first + 1; __i != __last; ++__i)
+ for (_RandomAccessIterator __i = __first + 1; __i != __last; ++__i)
iter_swap(__i, __first + __rand((__i - __first) + 1));
}
@@ -1677,9 +1677,9 @@ __result, __binary_pred, _IterType());
* This is a helper function...
* @endif
*/
- template
- _ForwardIter
- __partition(_ForwardIter __first, _ForwardIter __last,
+ template
+ _ForwardIterator
+ __partition(_ForwardIterator __first, _ForwardIterator __last,
_Predicate __pred,
forward_iterator_tag)
{
@@ -1688,7 +1688,7 @@ __result, __binary_pred, _IterType());
while (__pred(*__first))
if (++__first == __last) return __first;
- _ForwardIter __next = __first;
+ _ForwardIterator __next = __first;
while (++__next != __last)
if (__pred(*__next)) {
@@ -1704,9 +1704,9 @@ __result, __binary_pred, _IterType());
* This is a helper function...
* @endif
*/
- template
- _BidirectionalIter
- __partition(_BidirectionalIter __first, _BidirectionalIter __last,
+ template
+ _BidirectionalIterator
+ __partition(_BidirectionalIterator __first, _BidirectionalIterator __last,
_Predicate __pred,
bidirectional_iterator_tag)
{
@@ -1745,15 +1745,15 @@ __result, __binary_pred, _IterType());
* the relative ordering of elements in each group, use
* @p stable_partition() if this is needed.
*/
- template
- inline _ForwardIter
- partition(_ForwardIter __first, _ForwardIter __last,
+ template
+ inline _ForwardIterator
+ partition(_ForwardIterator __first, _ForwardIterator __last,
_Predicate __pred)
{
// concept requirements
- __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter>)
+ __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIterator>)
__glibcpp_function_requires(_UnaryPredicateConcept<_Predicate,
- typename iterator_traits<_ForwardIter>::value_type>)
+ typename iterator_traits<_ForwardIterator>::value_type>)
return __partition(__first, __last, __pred, __iterator_category(__first));
}
@@ -1764,19 +1764,19 @@ __result, __binary_pred, _IterType());
* This is a helper function...
* @endif
*/
- template
- _ForwardIter
- __inplace_stable_partition(_ForwardIter __first, _ForwardIter __last,
+ template
+ _ForwardIterator
+ __inplace_stable_partition(_ForwardIterator __first, _ForwardIterator __last,
_Predicate __pred, _Distance __len)
{
if (__len == 1)
return __pred(*__first) ? __last : __first;
- _ForwardIter __middle = __first;
+ _ForwardIterator __middle = __first;
advance(__middle, __len / 2);
- _ForwardIter __begin = __inplace_stable_partition(__first, __middle,
+ _ForwardIterator __begin = __inplace_stable_partition(__first, __middle,
__pred,
__len / 2);
- _ForwardIter __end = __inplace_stable_partition(__middle, __last,
+ _ForwardIterator __end = __inplace_stable_partition(__middle, __last,
__pred,
__len - __len / 2);
rotate(__begin, __middle, __end);
@@ -1789,16 +1789,16 @@ __result, __binary_pred, _IterType());
* This is a helper function...
* @endif
*/
- template
- _ForwardIter
- __stable_partition_adaptive(_ForwardIter __first, _ForwardIter __last,
+ _ForwardIterator
+ __stable_partition_adaptive(_ForwardIterator __first, _ForwardIterator __last,
_Predicate __pred, _Distance __len,
_Pointer __buffer,
_Distance __buffer_size)
{
if (__len <= __buffer_size) {
- _ForwardIter __result1 = __first;
+ _ForwardIterator __result1 = __first;
_Pointer __result2 = __buffer;
for ( ; __first != __last ; ++__first)
if (__pred(*__first)) {
@@ -1813,13 +1813,13 @@ __result, __binary_pred, _IterType());
return __result1;
}
else {
- _ForwardIter __middle = __first;
+ _ForwardIterator __middle = __first;
advance(__middle, __len / 2);
- _ForwardIter __begin = __stable_partition_adaptive(__first, __middle,
+ _ForwardIterator __begin = __stable_partition_adaptive(__first, __middle,
__pred,
__len / 2,
__buffer, __buffer_size);
- _ForwardIter __end = __stable_partition_adaptive( __middle, __last,
+ _ForwardIterator __end = __stable_partition_adaptive( __middle, __last,
__pred,
__len - __len / 2,
__buffer, __buffer_size);
@@ -1845,24 +1845,24 @@ __result, __binary_pred, _IterType());
* @p [first,last) such that @p pred(x)==pred(y) will have the same
* relative ordering after calling @p stable_partition().
*/
- template
- _ForwardIter
- stable_partition(_ForwardIter __first, _ForwardIter __last,
+ template
+ _ForwardIterator
+ stable_partition(_ForwardIterator __first, _ForwardIterator __last,
_Predicate __pred)
{
// concept requirements
- __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter>)
+ __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIterator>)
__glibcpp_function_requires(_UnaryPredicateConcept<_Predicate,
- typename iterator_traits<_ForwardIter>::value_type>)
+ typename iterator_traits<_ForwardIterator>::value_type>)
if (__first == __last)
return __first;
else
{
- typedef typename iterator_traits<_ForwardIter>::value_type _ValueType;
- typedef typename iterator_traits<_ForwardIter>::difference_type _DistanceType;
+ typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType;
+ typedef typename iterator_traits<_ForwardIterator>::difference_type _DistanceType;
- _Temporary_buffer<_ForwardIter, _ValueType> __buf(__first, __last);
+ _Temporary_buffer<_ForwardIterator, _ValueType> __buf(__first, __last);
if (__buf.size() > 0)
return __stable_partition_adaptive(__first, __last, __pred,
_DistanceType(__buf.requested_size()),
@@ -1878,9 +1878,9 @@ __result, __binary_pred, _IterType());
* This is a helper function...
* @endif
*/
- template
- _RandomAccessIter
- __unguarded_partition(_RandomAccessIter __first, _RandomAccessIter __last,
+ template
+ _RandomAccessIterator
+ __unguarded_partition(_RandomAccessIterator __first, _RandomAccessIterator __last,
_Tp __pivot)
{
while (true) {
@@ -1901,9 +1901,9 @@ __result, __binary_pred, _IterType());
* This is a helper function...
* @endif
*/
- template
- _RandomAccessIter
- __unguarded_partition(_RandomAccessIter __first, _RandomAccessIter __last,
+ template
+ _RandomAccessIterator
+ __unguarded_partition(_RandomAccessIterator __first, _RandomAccessIterator __last,
_Tp __pivot, _Compare __comp)
{
while (true) {
@@ -1933,11 +1933,11 @@ __result, __binary_pred, _IterType());
* This is a helper function for the sort routine.
* @endif
*/
- template
+ template
void
- __unguarded_linear_insert(_RandomAccessIter __last, _Tp __val)
+ __unguarded_linear_insert(_RandomAccessIterator __last, _Tp __val)
{
- _RandomAccessIter __next = __last;
+ _RandomAccessIterator __next = __last;
--__next;
while (__val < *__next) {
*__last = *__next;
@@ -1952,11 +1952,11 @@ __result, __binary_pred, _IterType());
* This is a helper function for the sort routine.
* @endif
*/
- template
+ template
void
- __unguarded_linear_insert(_RandomAccessIter __last, _Tp __val, _Compare __comp)
+ __unguarded_linear_insert(_RandomAccessIterator __last, _Tp __val, _Compare __comp)
{
- _RandomAccessIter __next = __last;
+ _RandomAccessIterator __next = __last;
--__next;
while (__comp(__val, *__next)) {
*__last = *__next;
@@ -1971,15 +1971,15 @@ __result, __binary_pred, _IterType());
* This is a helper function for the sort routine.
* @endif
*/
- template
+ template
void
- __insertion_sort(_RandomAccessIter __first, _RandomAccessIter __last)
+ __insertion_sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
{
if (__first == __last) return;
- for (_RandomAccessIter __i = __first + 1; __i != __last; ++__i)
+ for (_RandomAccessIterator __i = __first + 1; __i != __last; ++__i)
{
- typename iterator_traits<_RandomAccessIter>::value_type __val = *__i;
+ typename iterator_traits<_RandomAccessIterator>::value_type __val = *__i;
if (__val < *__first) {
copy_backward(__first, __i, __i + 1);
*__first = __val;
@@ -1994,16 +1994,16 @@ __result, __binary_pred, _IterType());
* This is a helper function for the sort routine.
* @endif
*/
- template
+ template
void
- __insertion_sort(_RandomAccessIter __first, _RandomAccessIter __last,
+ __insertion_sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
_Compare __comp)
{
if (__first == __last) return;
- for (_RandomAccessIter __i = __first + 1; __i != __last; ++__i)
+ for (_RandomAccessIterator __i = __first + 1; __i != __last; ++__i)
{
- typename iterator_traits<_RandomAccessIter>::value_type __val = *__i;
+ typename iterator_traits<_RandomAccessIterator>::value_type __val = *__i;
if (__comp(__val, *__first)) {
copy_backward(__first, __i, __i + 1);
*__first = __val;
@@ -2018,13 +2018,13 @@ __result, __binary_pred, _IterType());
* This is a helper function for the sort routine.
* @endif
*/
- template
+ template
inline void
- __unguarded_insertion_sort(_RandomAccessIter __first, _RandomAccessIter __last)
+ __unguarded_insertion_sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
{
- typedef typename iterator_traits<_RandomAccessIter>::value_type _ValueType;
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type _ValueType;
- for (_RandomAccessIter __i = __first; __i != __last; ++__i)
+ for (_RandomAccessIterator __i = __first; __i != __last; ++__i)
__unguarded_linear_insert(__i, _ValueType(*__i));
}
@@ -2033,14 +2033,14 @@ __result, __binary_pred, _IterType());
* This is a helper function for the sort routine.
* @endif
*/
- template
+ template
inline void
- __unguarded_insertion_sort(_RandomAccessIter __first, _RandomAccessIter __last,
+ __unguarded_insertion_sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
_Compare __comp)
{
- typedef typename iterator_traits<_RandomAccessIter>::value_type _ValueType;
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type _ValueType;
- for (_RandomAccessIter __i = __first; __i != __last; ++__i)
+ for (_RandomAccessIterator __i = __first; __i != __last; ++__i)
__unguarded_linear_insert(__i, _ValueType(*__i), __comp);
}
@@ -2049,9 +2049,9 @@ __result, __binary_pred, _IterType());
* This is a helper function for the sort routine.
* @endif
*/
- template
+ template
void
- __final_insertion_sort(_RandomAccessIter __first, _RandomAccessIter __last)
+ __final_insertion_sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
{
if (__last - __first > _S_threshold) {
__insertion_sort(__first, __first + _S_threshold);
@@ -2066,9 +2066,9 @@ __result, __binary_pred, _IterType());
* This is a helper function for the sort routine.
* @endif
*/
- template
+ template
void
- __final_insertion_sort(_RandomAccessIter __first, _RandomAccessIter __last,
+ __final_insertion_sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
_Compare __comp)
{
if (__last - __first > _S_threshold) {
@@ -2098,12 +2098,12 @@ __result, __binary_pred, _IterType());
* This is a helper function for the sort routine.
* @endif
*/
- template
+ template
void
- __introsort_loop(_RandomAccessIter __first, _RandomAccessIter __last,
+ __introsort_loop(_RandomAccessIterator __first, _RandomAccessIterator __last,
_Size __depth_limit)
{
- typedef typename iterator_traits<_RandomAccessIter>::value_type _ValueType;
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type _ValueType;
while (__last - __first > _S_threshold) {
if (__depth_limit == 0) {
@@ -2111,7 +2111,7 @@ __result, __binary_pred, _IterType());
return;
}
--__depth_limit;
- _RandomAccessIter __cut =
+ _RandomAccessIterator __cut =
__unguarded_partition(__first, __last,
_ValueType(__median(*__first,
*(__first + (__last - __first)/2),
@@ -2126,12 +2126,12 @@ __result, __binary_pred, _IterType());
* This is a helper function for the sort routine.
* @endif
*/
- template
+ template
void
- __introsort_loop(_RandomAccessIter __first, _RandomAccessIter __last,
+ __introsort_loop(_RandomAccessIterator __first, _RandomAccessIterator __last,
_Size __depth_limit, _Compare __comp)
{
- typedef typename iterator_traits<_RandomAccessIter>::value_type _ValueType;
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type _ValueType;
while (__last - __first > _S_threshold) {
if (__depth_limit == 0) {
@@ -2139,7 +2139,7 @@ __result, __binary_pred, _IterType());
return;
}
--__depth_limit;
- _RandomAccessIter __cut =
+ _RandomAccessIterator __cut =
__unguarded_partition(__first, __last,
_ValueType(__median(*__first,
*(__first + (__last - __first)/2),
@@ -2163,15 +2163,15 @@ __result, __binary_pred, _IterType());
* The relative ordering of equivalent elements is not preserved, use
* @p stable_sort() if this is needed.
*/
- template
+ template
inline void
- sort(_RandomAccessIter __first, _RandomAccessIter __last)
+ sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
{
- typedef typename iterator_traits<_RandomAccessIter>::value_type _ValueType;
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type _ValueType;
// concept requirements
__glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<
- _RandomAccessIter>)
+ _RandomAccessIterator>)
__glibcpp_function_requires(_LessThanComparableConcept<_ValueType>)
if (__first != __last) {
@@ -2194,15 +2194,15 @@ __result, __binary_pred, _IterType());
* The relative ordering of equivalent elements is not preserved, use
* @p stable_sort() if this is needed.
*/
- template
+ template
inline void
- sort(_RandomAccessIter __first, _RandomAccessIter __last, _Compare __comp)
+ sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
{
- typedef typename iterator_traits<_RandomAccessIter>::value_type _ValueType;
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type _ValueType;
// concept requirements
__glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<
- _RandomAccessIter>)
+ _RandomAccessIterator>)
__glibcpp_function_requires(_BinaryPredicateConcept<_Compare, _ValueType, _ValueType>)
if (__first != __last) {
@@ -2217,15 +2217,15 @@ __result, __binary_pred, _IterType());
* This is a helper function for the stable sorting routines.
* @endif
*/
- template
+ template
void
- __inplace_stable_sort(_RandomAccessIter __first, _RandomAccessIter __last)
+ __inplace_stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
{
if (__last - __first < 15) {
__insertion_sort(__first, __last);
return;
}
- _RandomAccessIter __middle = __first + (__last - __first) / 2;
+ _RandomAccessIterator __middle = __first + (__last - __first) / 2;
__inplace_stable_sort(__first, __middle);
__inplace_stable_sort(__middle, __last);
__merge_without_buffer(__first, __middle, __last,
@@ -2238,16 +2238,16 @@ __result, __binary_pred, _IterType());
* This is a helper function for the stable sorting routines.
* @endif
*/
- template
+ template
void
- __inplace_stable_sort(_RandomAccessIter __first, _RandomAccessIter __last,
+ __inplace_stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
_Compare __comp)
{
if (__last - __first < 15) {
__insertion_sort(__first, __last, __comp);
return;
}
- _RandomAccessIter __middle = __first + (__last - __first) / 2;
+ _RandomAccessIterator __middle = __first + (__last - __first) / 2;
__inplace_stable_sort(__first, __middle, __comp);
__inplace_stable_sort(__middle, __last, __comp);
__merge_without_buffer(__first, __middle, __last,
@@ -2256,11 +2256,11 @@ __result, __binary_pred, _IterType());
__comp);
}
- template
void
- __merge_sort_loop(_RandomAccessIter1 __first, _RandomAccessIter1 __last,
- _RandomAccessIter2 __result, _Distance __step_size)
+ __merge_sort_loop(_RandomAccessIterator1 __first, _RandomAccessIterator1 __last,
+ _RandomAccessIterator2 __result, _Distance __step_size)
{
_Distance __two_step = 2 * __step_size;
@@ -2276,11 +2276,11 @@ __result, __binary_pred, _IterType());
__result);
}
- template
void
- __merge_sort_loop(_RandomAccessIter1 __first, _RandomAccessIter1 __last,
- _RandomAccessIter2 __result, _Distance __step_size,
+ __merge_sort_loop(_RandomAccessIterator1 __first, _RandomAccessIterator1 __last,
+ _RandomAccessIterator2 __result, _Distance __step_size,
_Compare __comp)
{
_Distance __two_step = 2 * __step_size;
@@ -2302,9 +2302,9 @@ __result, __binary_pred, _IterType());
enum { _S_chunk_size = 7 };
- template
+ template
void
- __chunk_insertion_sort(_RandomAccessIter __first, _RandomAccessIter __last,
+ __chunk_insertion_sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
_Distance __chunk_size)
{
while (__last - __first >= __chunk_size) {
@@ -2314,9 +2314,9 @@ __result, __binary_pred, _IterType());
__insertion_sort(__first, __last);
}
- template
+ template
void
- __chunk_insertion_sort(_RandomAccessIter __first, _RandomAccessIter __last,
+ __chunk_insertion_sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
_Distance __chunk_size, _Compare __comp)
{
while (__last - __first >= __chunk_size) {
@@ -2326,12 +2326,12 @@ __result, __binary_pred, _IterType());
__insertion_sort(__first, __last, __comp);
}
- template
+ template
void
- __merge_sort_with_buffer(_RandomAccessIter __first, _RandomAccessIter __last,
+ __merge_sort_with_buffer(_RandomAccessIterator __first, _RandomAccessIterator __last,
_Pointer __buffer)
{
- typedef typename iterator_traits<_RandomAccessIter>::difference_type _Distance;
+ typedef typename iterator_traits<_RandomAccessIterator>::difference_type _Distance;
_Distance __len = __last - __first;
_Pointer __buffer_last = __buffer + __len;
@@ -2347,12 +2347,12 @@ __result, __binary_pred, _IterType());
}
}
- template
+ template
void
- __merge_sort_with_buffer(_RandomAccessIter __first, _RandomAccessIter __last,
+ __merge_sort_with_buffer(_RandomAccessIterator __first, _RandomAccessIterator __last,
_Pointer __buffer, _Compare __comp)
{
- typedef typename iterator_traits<_RandomAccessIter>::difference_type _Distance;
+ typedef typename iterator_traits<_RandomAccessIterator>::difference_type _Distance;
_Distance __len = __last - __first;
_Pointer __buffer_last = __buffer + __len;
@@ -2368,13 +2368,13 @@ __result, __binary_pred, _IterType());
}
}
- template
+ template
void
- __stable_sort_adaptive(_RandomAccessIter __first, _RandomAccessIter __last,
+ __stable_sort_adaptive(_RandomAccessIterator __first, _RandomAccessIterator __last,
_Pointer __buffer, _Distance __buffer_size)
{
_Distance __len = (__last - __first + 1) / 2;
- _RandomAccessIter __middle = __first + __len;
+ _RandomAccessIterator __middle = __first + __len;
if (__len > __buffer_size) {
__stable_sort_adaptive(__first, __middle, __buffer, __buffer_size);
__stable_sort_adaptive(__middle, __last, __buffer, __buffer_size);
@@ -2387,15 +2387,15 @@ __result, __binary_pred, _IterType());
_Distance(__last - __middle), __buffer, __buffer_size);
}
- template
void
- __stable_sort_adaptive(_RandomAccessIter __first, _RandomAccessIter __last,
+ __stable_sort_adaptive(_RandomAccessIterator __first, _RandomAccessIterator __last,
_Pointer __buffer, _Distance __buffer_size,
_Compare __comp)
{
_Distance __len = (__last - __first + 1) / 2;
- _RandomAccessIter __middle = __first + __len;
+ _RandomAccessIterator __middle = __first + __len;
if (__len > __buffer_size) {
__stable_sort_adaptive(__first, __middle, __buffer, __buffer_size,
__comp);
@@ -2427,19 +2427,19 @@ __result, __binary_pred, _IterType());
* @p x
+ template
inline void
- stable_sort(_RandomAccessIter __first, _RandomAccessIter __last)
+ stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
{
- typedef typename iterator_traits<_RandomAccessIter>::value_type _ValueType;
- typedef typename iterator_traits<_RandomAccessIter>::difference_type _DistanceType;
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type _ValueType;
+ typedef typename iterator_traits<_RandomAccessIterator>::difference_type _DistanceType;
// concept requirements
__glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<
- _RandomAccessIter>)
+ _RandomAccessIterator>)
__glibcpp_function_requires(_LessThanComparableConcept<_ValueType>)
- _Temporary_buffer<_RandomAccessIter, _ValueType> buf(__first, __last);
+ _Temporary_buffer<_RandomAccessIterator, _ValueType> buf(__first, __last);
if (buf.begin() == 0)
__inplace_stable_sort(__first, __last);
else
@@ -2463,20 +2463,20 @@ __result, __binary_pred, _IterType());
* @p comp(x,y) is false and @p comp(y,x) is false will have the same
* relative ordering after calling @p stable_sort().
*/
- template
+ template
inline void
- stable_sort(_RandomAccessIter __first, _RandomAccessIter __last, _Compare __comp)
+ stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
{
- typedef typename iterator_traits<_RandomAccessIter>::value_type _ValueType;
- typedef typename iterator_traits<_RandomAccessIter>::difference_type _DistanceType;
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type _ValueType;
+ typedef typename iterator_traits<_RandomAccessIterator>::difference_type _DistanceType;
// concept requirements
__glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<
- _RandomAccessIter>)
+ _RandomAccessIterator>)
__glibcpp_function_requires(_BinaryPredicateConcept<_Compare,
_ValueType, _ValueType>)
- _Temporary_buffer<_RandomAccessIter, _ValueType> buf(__first, __last);
+ _Temporary_buffer<_RandomAccessIterator, _ValueType> buf(__first, __last);
if (buf.begin() == 0)
__inplace_stable_sort(__first, __last, __comp);
else
@@ -2499,21 +2499,21 @@ __result, __binary_pred, _IterType());
* @p [first,middle) such that @i precedes @j and @k is an iterator in
* the range @p [middle,last) then @p *j<*i and @p *k<*i are both false.
*/
- template
+ template
void
- partial_sort(_RandomAccessIter __first,
- _RandomAccessIter __middle,
- _RandomAccessIter __last)
+ partial_sort(_RandomAccessIterator __first,
+ _RandomAccessIterator __middle,
+ _RandomAccessIterator __last)
{
- typedef typename iterator_traits<_RandomAccessIter>::value_type _ValueType;
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type _ValueType;
// concept requirements
__glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<
- _RandomAccessIter>)
+ _RandomAccessIterator>)
__glibcpp_function_requires(_LessThanComparableConcept<_ValueType>)
make_heap(__first, __middle);
- for (_RandomAccessIter __i = __middle; __i < __last; ++__i)
+ for (_RandomAccessIterator __i = __middle; __i < __last; ++__i)
if (*__i < *__first)
__pop_heap(__first, __middle, __i, _ValueType(*__i));
sort_heap(__first, __middle);
@@ -2537,23 +2537,23 @@ __result, __binary_pred, _IterType());
* the range @p [middle,last) then @p *comp(j,*i) and @p comp(*k,*i)
* are both false.
*/
- template
+ template
void
- partial_sort(_RandomAccessIter __first,
- _RandomAccessIter __middle,
- _RandomAccessIter __last,
+ partial_sort(_RandomAccessIterator __first,
+ _RandomAccessIterator __middle,
+ _RandomAccessIterator __last,
_Compare __comp)
{
- typedef typename iterator_traits<_RandomAccessIter>::value_type _ValueType;
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type _ValueType;
// concept requirements
__glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<
- _RandomAccessIter>)
+ _RandomAccessIterator>)
__glibcpp_function_requires(_BinaryPredicateConcept<_Compare,
_ValueType, _ValueType>)
make_heap(__first, __middle, __comp);
- for (_RandomAccessIter __i = __middle; __i < __last; ++__i)
+ for (_RandomAccessIterator __i = __middle; __i < __last; ++__i)
if (__comp(*__i, *__first))
__pop_heap(__first, __middle, __i, _ValueType(*__i), __comp);
sort_heap(__first, __middle, __comp);
@@ -2576,24 +2576,24 @@ __result, __binary_pred, _IterType());
* @p *j<*i is false.
* The value returned is @p result_first+N.
*/
- template
- _RandomAccessIter
- partial_sort_copy(_InputIter __first, _InputIter __last,
- _RandomAccessIter __result_first,
- _RandomAccessIter __result_last)
+ template
+ _RandomAccessIterator
+ partial_sort_copy(_InputIterator __first, _InputIterator __last,
+ _RandomAccessIterator __result_first,
+ _RandomAccessIterator __result_last)
{
- typedef typename iterator_traits<_InputIter>::value_type _InputValueType;
- typedef typename iterator_traits<_RandomAccessIter>::value_type _OutputValueType;
- typedef typename iterator_traits<_RandomAccessIter>::difference_type _DistanceType;
+ typedef typename iterator_traits<_InputIterator>::value_type _InputValueType;
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type _OutputValueType;
+ typedef typename iterator_traits<_RandomAccessIterator>::difference_type _DistanceType;
// concept requirements
- __glibcpp_function_requires(_InputIteratorConcept<_InputIter>)
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIterator>)
__glibcpp_function_requires(_ConvertibleConcept<_InputValueType, _OutputValueType>)
__glibcpp_function_requires(_LessThanComparableConcept<_OutputValueType>)
__glibcpp_function_requires(_LessThanComparableConcept<_InputValueType>)
if (__result_first == __result_last) return __result_last;
- _RandomAccessIter __result_real_last = __result_first;
+ _RandomAccessIterator __result_real_last = __result_first;
while(__first != __last && __result_real_last != __result_last) {
*__result_real_last = *__first;
++__result_real_last;
@@ -2630,26 +2630,26 @@ __result, __binary_pred, _IterType());
* @p comp(*j,*i) is false.
* The value returned is @p result_first+N.
*/
- template
- _RandomAccessIter
- partial_sort_copy(_InputIter __first, _InputIter __last,
- _RandomAccessIter __result_first,
- _RandomAccessIter __result_last,
+ template
+ _RandomAccessIterator
+ partial_sort_copy(_InputIterator __first, _InputIterator __last,
+ _RandomAccessIterator __result_first,
+ _RandomAccessIterator __result_last,
_Compare __comp)
{
- typedef typename iterator_traits<_InputIter>::value_type _InputValueType;
- typedef typename iterator_traits<_RandomAccessIter>::value_type _OutputValueType;
- typedef typename iterator_traits<_RandomAccessIter>::difference_type _DistanceType;
+ typedef typename iterator_traits<_InputIterator>::value_type _InputValueType;
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type _OutputValueType;
+ typedef typename iterator_traits<_RandomAccessIterator>::difference_type _DistanceType;
// concept requirements
- __glibcpp_function_requires(_InputIteratorConcept<_InputIter>)
- __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<_RandomAccessIter>)
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<_RandomAccessIterator>)
__glibcpp_function_requires(_ConvertibleConcept<_InputValueType, _OutputValueType>)
__glibcpp_function_requires(_BinaryPredicateConcept<_Compare,
_OutputValueType, _OutputValueType>)
if (__result_first == __result_last) return __result_last;
- _RandomAccessIter __result_real_last = __result_first;
+ _RandomAccessIterator __result_real_last = __result_first;
while(__first != __last && __result_real_last != __result_last) {
*__result_real_last = *__first;
++__result_real_last;
@@ -2683,20 +2683,20 @@ __result, __binary_pred, _IterType());
* @p [first,nth) and any iterator @j in the range @p [nth,last) it
* holds that @p *j<*i is false.
*/
- template
+ template
void
- nth_element(_RandomAccessIter __first,
- _RandomAccessIter __nth,
- _RandomAccessIter __last)
+ nth_element(_RandomAccessIterator __first,
+ _RandomAccessIterator __nth,
+ _RandomAccessIterator __last)
{
- typedef typename iterator_traits<_RandomAccessIter>::value_type _ValueType;
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type _ValueType;
// concept requirements
- __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<_RandomAccessIter>)
+ __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<_RandomAccessIterator>)
__glibcpp_function_requires(_LessThanComparableConcept<_ValueType>)
while (__last - __first > 3) {
- _RandomAccessIter __cut =
+ _RandomAccessIterator __cut =
__unguarded_partition(__first, __last,
_ValueType(__median(*__first,
*(__first + (__last - __first)/2),
@@ -2725,22 +2725,22 @@ __result, __binary_pred, _IterType());
* @p [first,nth) and any iterator @j in the range @p [nth,last) it
* holds that @p comp(*j,*i) is false.
*/
- template
+ template
void
- nth_element(_RandomAccessIter __first,
- _RandomAccessIter __nth,
- _RandomAccessIter __last,
+ nth_element(_RandomAccessIterator __first,
+ _RandomAccessIterator __nth,
+ _RandomAccessIterator __last,
_Compare __comp)
{
- typedef typename iterator_traits<_RandomAccessIter>::value_type _ValueType;
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type _ValueType;
// concept requirements
- __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<_RandomAccessIter>)
+ __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<_RandomAccessIterator>)
__glibcpp_function_requires(_BinaryPredicateConcept<_Compare,
_ValueType, _ValueType>)
while (__last - __first > 3) {
- _RandomAccessIter __cut =
+ _RandomAccessIterator __cut =
__unguarded_partition(__first, __last,
_ValueType(__median(*__first,
*(__first + (__last - __first)/2),
@@ -2762,28 +2762,29 @@ __result, __binary_pred, _IterType());
* @param first An iterator.
* @param last Another iterator.
* @param val The search term.
- * @return An iterator pointing to the first element "not less than" @a val.
+ * @return An iterator pointing to the first element "not less than" @a val,
+ * or end() if every element is less than @a val.
* @ingroup binarysearch
*/
- template
- _ForwardIter
- lower_bound(_ForwardIter __first, _ForwardIter __last, const _Tp& __val)
+ template
+ _ForwardIterator
+ lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __val)
{
- typedef typename iterator_traits<_ForwardIter>::value_type _ValueType;
- typedef typename iterator_traits<_ForwardIter>::difference_type _DistanceType;
+ typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType;
+ typedef typename iterator_traits<_ForwardIterator>::difference_type _DistanceType;
// concept requirements
// Note that these are slightly stricter than those of the 4-argument
// version, defined next. The difference is in the strictness of the
// comparison operations... so for looser checking, define your own
// comparison function, as was intended.
- __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>)
+ __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
__glibcpp_function_requires(_SameTypeConcept<_Tp, _ValueType>)
__glibcpp_function_requires(_LessThanComparableConcept<_Tp>)
_DistanceType __len = std::distance(__first, __last);
_DistanceType __half;
- _ForwardIter __middle;
+ _ForwardIterator __middle;
while (__len > 0) {
__half = __len >> 1;
@@ -2807,27 +2808,28 @@ __result, __binary_pred, _IterType());
* @param last Another iterator.
* @param val The search term.
* @param comp A functor to use for comparisons.
- * @return An iterator pointing to the first element "not less than" @a val.
+ * @return An iterator pointing to the first element "not less than" @a val,
+ * or end() if every element is less than @a val.
* @ingroup binarysearch
*
* The comparison function should have the same effects on ordering as
* the function used for the initial sort.
*/
- template
- _ForwardIter
- lower_bound(_ForwardIter __first, _ForwardIter __last,
+ template
+ _ForwardIterator
+ lower_bound(_ForwardIterator __first, _ForwardIterator __last,
const _Tp& __val, _Compare __comp)
{
- typedef typename iterator_traits<_ForwardIter>::value_type _ValueType;
- typedef typename iterator_traits<_ForwardIter>::difference_type _DistanceType;
+ typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType;
+ typedef typename iterator_traits<_ForwardIterator>::difference_type _DistanceType;
// concept requirements
- __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>)
+ __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
__glibcpp_function_requires(_BinaryPredicateConcept<_Compare, _ValueType, _Tp>)
_DistanceType __len = std::distance(__first, __last);
_DistanceType __half;
- _ForwardIter __middle;
+ _ForwardIterator __middle;
while (__len > 0) {
__half = __len >> 1;
@@ -2850,25 +2852,26 @@ __result, __binary_pred, _IterType());
* @param first An iterator.
* @param last Another iterator.
* @param val The search term.
- * @return An iterator pointing to the first element greater than @a val.
+ * @return An iterator pointing to the first element greater than @a val,
+ * or end() if no elements are greater than @a val.
* @ingroup binarysearch
*/
- template
- _ForwardIter
- upper_bound(_ForwardIter __first, _ForwardIter __last, const _Tp& __val)
+ template
+ _ForwardIterator
+ upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __val)
{
- typedef typename iterator_traits<_ForwardIter>::value_type _ValueType;
- typedef typename iterator_traits<_ForwardIter>::difference_type _DistanceType;
+ typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType;
+ typedef typename iterator_traits<_ForwardIterator>::difference_type _DistanceType;
// concept requirements
// See comments on lower_bound.
- __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>)
+ __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
__glibcpp_function_requires(_SameTypeConcept<_Tp, _ValueType>)
__glibcpp_function_requires(_LessThanComparableConcept<_Tp>)
_DistanceType __len = std::distance(__first, __last);
_DistanceType __half;
- _ForwardIter __middle;
+ _ForwardIterator __middle;
while (__len > 0) {
__half = __len >> 1;
@@ -2892,27 +2895,28 @@ __result, __binary_pred, _IterType());
* @param last Another iterator.
* @param val The search term.
* @param comp A functor to use for comparisons.
- * @return An iterator pointing to the first element greater than @a val.
+ * @return An iterator pointing to the first element greater than @a val,
+ * or end() if no elements are greater than @a val.
* @ingroup binarysearch
*
* The comparison function should have the same effects on ordering as
* the function used for the initial sort.
*/
- template
- _ForwardIter
- upper_bound(_ForwardIter __first, _ForwardIter __last,
+ template
+ _ForwardIterator
+ upper_bound(_ForwardIterator __first, _ForwardIterator __last,
const _Tp& __val, _Compare __comp)
{
- typedef typename iterator_traits<_ForwardIter>::value_type _ValueType;
- typedef typename iterator_traits<_ForwardIter>::difference_type _DistanceType;
+ typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType;
+ typedef typename iterator_traits<_ForwardIterator>::difference_type _DistanceType;
// concept requirements
- __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>)
+ __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
__glibcpp_function_requires(_BinaryPredicateConcept<_Compare, _Tp, _ValueType>)
_DistanceType __len = std::distance(__first, __last);
_DistanceType __half;
- _ForwardIter __middle;
+ _ForwardIterator __middle;
while (__len > 0) {
__half = __len >> 1;
@@ -2945,22 +2949,22 @@ __result, __binary_pred, _IterType());
* @endcode
* but does not actually call those functions.
*/
- template
- pair<_ForwardIter, _ForwardIter>
- equal_range(_ForwardIter __first, _ForwardIter __last, const _Tp& __val)
+ template
+ pair<_ForwardIterator, _ForwardIterator>
+ equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __val)
{
- typedef typename iterator_traits<_ForwardIter>::value_type _ValueType;
- typedef typename iterator_traits<_ForwardIter>::difference_type _DistanceType;
+ typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType;
+ typedef typename iterator_traits<_ForwardIterator>::difference_type _DistanceType;
// concept requirements
// See comments on lower_bound.
- __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>)
+ __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
__glibcpp_function_requires(_SameTypeConcept<_Tp, _ValueType>)
__glibcpp_function_requires(_LessThanComparableConcept<_Tp>)
_DistanceType __len = std::distance(__first, __last);
_DistanceType __half;
- _ForwardIter __middle, __left, __right;
+ _ForwardIterator __middle, __left, __right;
while (__len > 0) {
__half = __len >> 1;
@@ -2977,10 +2981,10 @@ __result, __binary_pred, _IterType());
__left = lower_bound(__first, __middle, __val);
advance(__first, __len);
__right = upper_bound(++__middle, __first, __val);
- return pair<_ForwardIter, _ForwardIter>(__left, __right);
+ return pair<_ForwardIterator, _ForwardIterator>(__left, __right);
}
}
- return pair<_ForwardIter, _ForwardIter>(__first, __first);
+ return pair<_ForwardIterator, _ForwardIterator>(__first, __first);
}
/**
@@ -3000,22 +3004,22 @@ __result, __binary_pred, _IterType());
* @endcode
* but does not actually call those functions.
*/
- template
- pair<_ForwardIter, _ForwardIter>
- equal_range(_ForwardIter __first, _ForwardIter __last, const _Tp& __val,
+ template
+ pair<_ForwardIterator, _ForwardIterator>
+ equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __val,
_Compare __comp)
{
- typedef typename iterator_traits<_ForwardIter>::value_type _ValueType;
- typedef typename iterator_traits<_ForwardIter>::difference_type _DistanceType;
+ typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType;
+ typedef typename iterator_traits<_ForwardIterator>::difference_type _DistanceType;
// concept requirements
- __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>)
+ __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
__glibcpp_function_requires(_BinaryPredicateConcept<_Compare, _ValueType, _Tp>)
__glibcpp_function_requires(_BinaryPredicateConcept<_Compare, _Tp, _ValueType>)
_DistanceType __len = std::distance(__first, __last);
_DistanceType __half;
- _ForwardIter __middle, __left, __right;
+ _ForwardIterator __middle, __left, __right;
while (__len > 0) {
__half = __len >> 1;
@@ -3032,10 +3036,10 @@ __result, __binary_pred, _IterType());
__left = lower_bound(__first, __middle, __val, __comp);
advance(__first, __len);
__right = upper_bound(++__middle, __first, __val, __comp);
- return pair<_ForwardIter, _ForwardIter>(__left, __right);
+ return pair<_ForwardIterator, _ForwardIterator>(__left, __right);
}
}
- return pair<_ForwardIter, _ForwardIter>(__first, __first);
+ return pair<_ForwardIterator, _ForwardIterator>(__first, __first);
}
/**
@@ -3049,19 +3053,19 @@ __result, __binary_pred, _IterType());
* Note that this does not actually return an iterator to @a val. For
* that, use std::find or a container's specialized find member functions.
*/
- template
+ template
bool
- binary_search(_ForwardIter __first, _ForwardIter __last,
+ binary_search(_ForwardIterator __first, _ForwardIterator __last,
const _Tp& __val)
{
// concept requirements
// See comments on lower_bound.
- __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>)
+ __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
__glibcpp_function_requires(_SameTypeConcept<_Tp,
- typename iterator_traits<_ForwardIter>::value_type>)
+ typename iterator_traits<_ForwardIterator>::value_type>)
__glibcpp_function_requires(_LessThanComparableConcept<_Tp>)
- _ForwardIter __i = lower_bound(__first, __last, __val);
+ _ForwardIterator __i = lower_bound(__first, __last, __val);
return __i != __last && !(__val < *__i);
}
@@ -3080,19 +3084,19 @@ __result, __binary_pred, _IterType());
* The comparison function should have the same effects on ordering as
* the function used for the initial sort.
*/
- template
+ template
bool
- binary_search(_ForwardIter __first, _ForwardIter __last,
+ binary_search(_ForwardIterator __first, _ForwardIterator __last,
const _Tp& __val, _Compare __comp)
{
// concept requirements
- __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>)
+ __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
__glibcpp_function_requires(_BinaryPredicateConcept<_Compare,
- typename iterator_traits<_ForwardIter>::value_type, _Tp>)
+ typename iterator_traits<_ForwardIterator>::value_type, _Tp>)
__glibcpp_function_requires(_BinaryPredicateConcept<_Compare, _Tp,
- typename iterator_traits<_ForwardIter>::value_type>)
+ typename iterator_traits<_ForwardIterator>::value_type>)
- _ForwardIter __i = lower_bound(__first, __last, __val, __comp);
+ _ForwardIterator __i = lower_bound(__first, __last, __val, __comp);
return __i != __last && !__comp(__val, *__i);
}
@@ -3112,22 +3116,22 @@ __result, __binary_pred, _IterType());
* elements in the two ranges, elements from the first range will always
* come before elements from the second.
*/
- template
- _OutputIter
- merge(_InputIter1 __first1, _InputIter1 __last1,
- _InputIter2 __first2, _InputIter2 __last2,
- _OutputIter __result)
+ template
+ _OutputIterator
+ merge(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _InputIterator2 __last2,
+ _OutputIterator __result)
{
// concept requirements
- __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>)
- __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>)
- __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
- typename iterator_traits<_InputIter1>::value_type>)
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIterator1>)
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIterator2>)
+ __glibcpp_function_requires(_OutputIteratorConcept<_OutputIterator,
+ typename iterator_traits<_InputIterator1>::value_type>)
__glibcpp_function_requires(_SameTypeConcept<
- typename iterator_traits<_InputIter1>::value_type,
- typename iterator_traits<_InputIter2>::value_type>)
+ typename iterator_traits<_InputIterator1>::value_type,
+ typename iterator_traits<_InputIterator2>::value_type>)
__glibcpp_function_requires(_LessThanComparableConcept<
- typename iterator_traits<_InputIter1>::value_type>)
+ typename iterator_traits<_InputIterator1>::value_type>)
while (__first1 != __last1 && __first2 != __last2) {
if (*__first2 < *__first1) {
@@ -3163,24 +3167,24 @@ __result, __binary_pred, _IterType());
* The comparison function should have the same effects on ordering as
* the function used for the initial sort.
*/
- template
- _OutputIter
- merge(_InputIter1 __first1, _InputIter1 __last1,
- _InputIter2 __first2, _InputIter2 __last2,
- _OutputIter __result, _Compare __comp)
+ _OutputIterator
+ merge(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _InputIterator2 __last2,
+ _OutputIterator __result, _Compare __comp)
{
// concept requirements
- __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>)
- __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>)
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIterator1>)
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIterator2>)
__glibcpp_function_requires(_SameTypeConcept<
- typename iterator_traits<_InputIter1>::value_type,
- typename iterator_traits<_InputIter2>::value_type>)
- __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
- typename iterator_traits<_InputIter1>::value_type>)
+ typename iterator_traits<_InputIterator1>::value_type,
+ typename iterator_traits<_InputIterator2>::value_type>)
+ __glibcpp_function_requires(_OutputIteratorConcept<_OutputIterator,
+ typename iterator_traits<_InputIterator1>::value_type>)
__glibcpp_function_requires(_BinaryPredicateConcept<_Compare,
- typename iterator_traits<_InputIter1>::value_type,
- typename iterator_traits<_InputIter2>::value_type>)
+ typename iterator_traits<_InputIterator1>::value_type,
+ typename iterator_traits<_InputIterator2>::value_type>)
while (__first1 != __last1 && __first2 != __last2) {
if (__comp(*__first2, *__first1)) {
@@ -3201,11 +3205,11 @@ __result, __binary_pred, _IterType());
* This is a helper function for the merge routines.
* @endif
*/
- template
+ template
void
- __merge_without_buffer(_BidirectionalIter __first,
- _BidirectionalIter __middle,
- _BidirectionalIter __last,
+ __merge_without_buffer(_BidirectionalIterator __first,
+ _BidirectionalIterator __middle,
+ _BidirectionalIterator __last,
_Distance __len1, _Distance __len2)
{
if (__len1 == 0 || __len2 == 0)
@@ -3215,8 +3219,8 @@ __result, __binary_pred, _IterType());
iter_swap(__first, __middle);
return;
}
- _BidirectionalIter __first_cut = __first;
- _BidirectionalIter __second_cut = __middle;
+ _BidirectionalIterator __first_cut = __first;
+ _BidirectionalIterator __second_cut = __middle;
_Distance __len11 = 0;
_Distance __len22 = 0;
if (__len1 > __len2) {
@@ -3232,7 +3236,7 @@ __result, __binary_pred, _IterType());
__len11 = std::distance(__first, __first_cut);
}
rotate(__first_cut, __middle, __second_cut);
- _BidirectionalIter __new_middle = __first_cut;
+ _BidirectionalIterator __new_middle = __first_cut;
advance(__new_middle, std::distance(__middle, __second_cut));
__merge_without_buffer(__first, __first_cut, __new_middle,
__len11, __len22);
@@ -3245,11 +3249,11 @@ __result, __binary_pred, _IterType());
* This is a helper function for the merge routines.
* @endif
*/
- template
+ template
void
- __merge_without_buffer(_BidirectionalIter __first,
- _BidirectionalIter __middle,
- _BidirectionalIter __last,
+ __merge_without_buffer(_BidirectionalIterator __first,
+ _BidirectionalIterator __middle,
+ _BidirectionalIterator __last,
_Distance __len1, _Distance __len2,
_Compare __comp)
{
@@ -3260,8 +3264,8 @@ __result, __binary_pred, _IterType());
iter_swap(__first, __middle);
return;
}
- _BidirectionalIter __first_cut = __first;
- _BidirectionalIter __second_cut = __middle;
+ _BidirectionalIterator __first_cut = __first;
+ _BidirectionalIterator __second_cut = __middle;
_Distance __len11 = 0;
_Distance __len22 = 0;
if (__len1 > __len2) {
@@ -3277,7 +3281,7 @@ __result, __binary_pred, _IterType());
__len11 = std::distance(__first, __first_cut);
}
rotate(__first_cut, __middle, __second_cut);
- _BidirectionalIter __new_middle = __first_cut;
+ _BidirectionalIterator __new_middle = __first_cut;
advance(__new_middle, std::distance(__middle, __second_cut));
__merge_without_buffer(__first, __first_cut, __new_middle,
__len11, __len22, __comp);
@@ -3290,17 +3294,17 @@ __result, __binary_pred, _IterType());
* This is a helper function for the merge routines.
* @endif
*/
- template
- _BidirectionalIter1
- __rotate_adaptive(_BidirectionalIter1 __first,
- _BidirectionalIter1 __middle,
- _BidirectionalIter1 __last,
+ _BidirectionalIterator1
+ __rotate_adaptive(_BidirectionalIterator1 __first,
+ _BidirectionalIterator1 __middle,
+ _BidirectionalIterator1 __last,
_Distance __len1, _Distance __len2,
- _BidirectionalIter2 __buffer,
+ _BidirectionalIterator2 __buffer,
_Distance __buffer_size)
{
- _BidirectionalIter2 __buffer_end;
+ _BidirectionalIterator2 __buffer_end;
if (__len1 > __len2 && __len2 <= __buffer_size) {
__buffer_end = copy(__middle, __last, __buffer);
copy_backward(__first, __middle, __last);
@@ -3323,12 +3327,12 @@ __result, __binary_pred, _IterType());
* This is a helper function for the merge routines.
* @endif
*/
- template
- _BidirectionalIter3
- __merge_backward(_BidirectionalIter1 __first1, _BidirectionalIter1 __last1,
- _BidirectionalIter2 __first2, _BidirectionalIter2 __last2,
- _BidirectionalIter3 __result)
+ template
+ _BidirectionalIterator3
+ __merge_backward(_BidirectionalIterator1 __first1, _BidirectionalIterator1 __last1,
+ _BidirectionalIterator2 __first2, _BidirectionalIterator2 __last2,
+ _BidirectionalIterator3 __result)
{
if (__first1 == __last1)
return copy_backward(__first2, __last2, __result);
@@ -3357,12 +3361,12 @@ __result, __binary_pred, _IterType());
* This is a helper function for the merge routines.
* @endif
*/
- template
- _BidirectionalIter3
- __merge_backward(_BidirectionalIter1 __first1, _BidirectionalIter1 __last1,
- _BidirectionalIter2 __first2, _BidirectionalIter2 __last2,
- _BidirectionalIter3 __result,
+ template
+ _BidirectionalIterator3
+ __merge_backward(_BidirectionalIterator1 __first1, _BidirectionalIterator1 __last1,
+ _BidirectionalIterator2 __first2, _BidirectionalIterator2 __last2,
+ _BidirectionalIterator3 __result,
_Compare __comp)
{
if (__first1 == __last1)
@@ -3392,11 +3396,11 @@ __result, __binary_pred, _IterType());
* This is a helper function for the merge routines.
* @endif
*/
- template
+ template
void
- __merge_adaptive(_BidirectionalIter __first,
- _BidirectionalIter __middle,
- _BidirectionalIter __last,
+ __merge_adaptive(_BidirectionalIterator __first,
+ _BidirectionalIterator __middle,
+ _BidirectionalIterator __last,
_Distance __len1, _Distance __len2,
_Pointer __buffer, _Distance __buffer_size)
{
@@ -3409,8 +3413,8 @@ __result, __binary_pred, _IterType());
__merge_backward(__first, __middle, __buffer, __buffer_end, __last);
}
else {
- _BidirectionalIter __first_cut = __first;
- _BidirectionalIter __second_cut = __middle;
+ _BidirectionalIterator __first_cut = __first;
+ _BidirectionalIterator __second_cut = __middle;
_Distance __len11 = 0;
_Distance __len22 = 0;
if (__len1 > __len2) {
@@ -3425,7 +3429,7 @@ __result, __binary_pred, _IterType());
__first_cut = upper_bound(__first, __middle, *__second_cut);
__len11 = std::distance(__first, __first_cut);
}
- _BidirectionalIter __new_middle =
+ _BidirectionalIterator __new_middle =
__rotate_adaptive(__first_cut, __middle, __second_cut,
__len1 - __len11, __len22, __buffer,
__buffer_size);
@@ -3441,12 +3445,12 @@ __result, __binary_pred, _IterType());
* This is a helper function for the merge routines.
* @endif
*/
- template
void
- __merge_adaptive(_BidirectionalIter __first,
- _BidirectionalIter __middle,
- _BidirectionalIter __last,
+ __merge_adaptive(_BidirectionalIterator __first,
+ _BidirectionalIterator __middle,
+ _BidirectionalIterator __last,
_Distance __len1, _Distance __len2,
_Pointer __buffer, _Distance __buffer_size,
_Compare __comp)
@@ -3461,8 +3465,8 @@ __result, __binary_pred, _IterType());
__comp);
}
else {
- _BidirectionalIter __first_cut = __first;
- _BidirectionalIter __second_cut = __middle;
+ _BidirectionalIterator __first_cut = __first;
+ _BidirectionalIterator __second_cut = __middle;
_Distance __len11 = 0;
_Distance __len22 = 0;
if (__len1 > __len2) {
@@ -3477,7 +3481,7 @@ __result, __binary_pred, _IterType());
__first_cut = upper_bound(__first, __middle, *__second_cut, __comp);
__len11 = std::distance(__first, __first_cut);
}
- _BidirectionalIter __new_middle =
+ _BidirectionalIterator __new_middle =
__rotate_adaptive(__first_cut, __middle, __second_cut,
__len1 - __len11, __len22, __buffer,
__buffer_size);
@@ -3505,20 +3509,20 @@ __result, __binary_pred, _IterType());
* comparisons. Otherwise an NlogN algorithm is used, where N is
* distance(first,last).
*/
- template
+ template
void
- inplace_merge(_BidirectionalIter __first,
- _BidirectionalIter __middle,
- _BidirectionalIter __last)
+ inplace_merge(_BidirectionalIterator __first,
+ _BidirectionalIterator __middle,
+ _BidirectionalIterator __last)
{
- typedef typename iterator_traits<_BidirectionalIter>::value_type
+ typedef typename iterator_traits<_BidirectionalIterator>::value_type
_ValueType;
- typedef typename iterator_traits<_BidirectionalIter>::difference_type
+ typedef typename iterator_traits<_BidirectionalIterator>::difference_type
_DistanceType;
// concept requirements
__glibcpp_function_requires(_Mutable_BidirectionalIteratorConcept<
- _BidirectionalIter>)
+ _BidirectionalIterator>)
__glibcpp_function_requires(_LessThanComparableConcept<_ValueType>)
if (__first == __middle || __middle == __last)
@@ -3527,7 +3531,7 @@ __result, __binary_pred, _IterType());
_DistanceType __len1 = std::distance(__first, __middle);
_DistanceType __len2 = std::distance(__middle, __last);
- _Temporary_buffer<_BidirectionalIter, _ValueType> __buf(__first, __last);
+ _Temporary_buffer<_BidirectionalIterator, _ValueType> __buf(__first, __last);
if (__buf.begin() == 0)
__merge_without_buffer(__first, __middle, __last, __len1, __len2);
else
@@ -3556,21 +3560,21 @@ __result, __binary_pred, _IterType());
* The comparison function should have the same effects on ordering as
* the function used for the initial sort.
*/
- template
+ template
void
- inplace_merge(_BidirectionalIter __first,
- _BidirectionalIter __middle,
- _BidirectionalIter __last,
+ inplace_merge(_BidirectionalIterator __first,
+ _BidirectionalIterator __middle,
+ _BidirectionalIterator __last,
_Compare __comp)
{
- typedef typename iterator_traits<_BidirectionalIter>::value_type
+ typedef typename iterator_traits<_BidirectionalIterator>::value_type
_ValueType;
- typedef typename iterator_traits<_BidirectionalIter>::difference_type
+ typedef typename iterator_traits<_BidirectionalIterator>::difference_type
_DistanceType;
// concept requirements
__glibcpp_function_requires(_Mutable_BidirectionalIteratorConcept<
- _BidirectionalIter>)
+ _BidirectionalIterator>)
__glibcpp_function_requires(_BinaryPredicateConcept<_Compare,
_ValueType, _ValueType>)
@@ -3580,7 +3584,7 @@ __result, __binary_pred, _IterType());
_DistanceType __len1 = std::distance(__first, __middle);
_DistanceType __len2 = std::distance(__middle, __last);
- _Temporary_buffer<_BidirectionalIter, _ValueType> __buf(__first, __last);
+ _Temporary_buffer<_BidirectionalIterator, _ValueType> __buf(__first, __last);
if (__buf.begin() == 0)
__merge_without_buffer(__first, __middle, __last, __len1, __len2, __comp);
else
@@ -3594,19 +3598,19 @@ __result, __binary_pred, _IterType());
// that their input ranges are sorted and the postcondition that their output
// ranges are sorted.
- template
+ template
bool
- includes(_InputIter1 __first1, _InputIter1 __last1,
- _InputIter2 __first2, _InputIter2 __last2)
+ includes(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _InputIterator2 __last2)
{
// concept requirements
- __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>)
- __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>)
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIterator1>)
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIterator2>)
__glibcpp_function_requires(_SameTypeConcept<
- typename iterator_traits<_InputIter1>::value_type,
- typename iterator_traits<_InputIter2>::value_type>)
+ typename iterator_traits<_InputIterator1>::value_type,
+ typename iterator_traits<_InputIterator2>::value_type>)
__glibcpp_function_requires(_LessThanComparableConcept<
- typename iterator_traits<_InputIter1>::value_type>)
+ typename iterator_traits<_InputIterator1>::value_type>)
while (__first1 != __last1 && __first2 != __last2)
if (*__first2 < *__first1)
@@ -3619,20 +3623,20 @@ __result, __binary_pred, _IterType());
return __first2 == __last2;
}
- template
+ template
bool
- includes(_InputIter1 __first1, _InputIter1 __last1,
- _InputIter2 __first2, _InputIter2 __last2, _Compare __comp)
+ includes(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _InputIterator2 __last2, _Compare __comp)
{
// concept requirements
- __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>)
- __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>)
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIterator1>)
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIterator2>)
__glibcpp_function_requires(_SameTypeConcept<
- typename iterator_traits<_InputIter1>::value_type,
- typename iterator_traits<_InputIter2>::value_type>)
+ typename iterator_traits<_InputIterator1>::value_type,
+ typename iterator_traits<_InputIterator2>::value_type>)
__glibcpp_function_requires(_BinaryPredicateConcept<_Compare,
- typename iterator_traits<_InputIter1>::value_type,
- typename iterator_traits<_InputIter2>::value_type>)
+ typename iterator_traits<_InputIterator1>::value_type,
+ typename iterator_traits<_InputIterator2>::value_type>)
while (__first1 != __last1 && __first2 != __last2)
if (__comp(*__first2, *__first1))
@@ -3645,22 +3649,22 @@ __result, __binary_pred, _IterType());
return __first2 == __last2;
}
- template
- _OutputIter
- set_union(_InputIter1 __first1, _InputIter1 __last1,
- _InputIter2 __first2, _InputIter2 __last2,
- _OutputIter __result)
+ template
+ _OutputIterator
+ set_union(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _InputIterator2 __last2,
+ _OutputIterator __result)
{
// concept requirements
- __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>)
- __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>)
- __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
- typename iterator_traits<_InputIter1>::value_type>)
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIterator1>)
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIterator2>)
+ __glibcpp_function_requires(_OutputIteratorConcept<_OutputIterator,
+ typename iterator_traits<_InputIterator1>::value_type>)
__glibcpp_function_requires(_SameTypeConcept<
- typename iterator_traits<_InputIter1>::value_type,
- typename iterator_traits<_InputIter2>::value_type>)
+ typename iterator_traits<_InputIterator1>::value_type,
+ typename iterator_traits<_InputIterator2>::value_type>)
__glibcpp_function_requires(_LessThanComparableConcept<
- typename iterator_traits<_InputIter1>::value_type>)
+ typename iterator_traits<_InputIterator1>::value_type>)
while (__first1 != __last1 && __first2 != __last2) {
if (*__first1 < *__first2) {
@@ -3681,24 +3685,24 @@ __result, __binary_pred, _IterType());
return copy(__first2, __last2, copy(__first1, __last1, __result));
}
- template
- _OutputIter
- set_union(_InputIter1 __first1, _InputIter1 __last1,
- _InputIter2 __first2, _InputIter2 __last2,
- _OutputIter __result, _Compare __comp)
+ _OutputIterator
+ set_union(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _InputIterator2 __last2,
+ _OutputIterator __result, _Compare __comp)
{
// concept requirements
- __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>)
- __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>)
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIterator1>)
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIterator2>)
__glibcpp_function_requires(_SameTypeConcept<
- typename iterator_traits<_InputIter1>::value_type,
- typename iterator_traits<_InputIter2>::value_type>)
- __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
- typename iterator_traits<_InputIter1>::value_type>)
+ typename iterator_traits<_InputIterator1>::value_type,
+ typename iterator_traits<_InputIterator2>::value_type>)
+ __glibcpp_function_requires(_OutputIteratorConcept<_OutputIterator,
+ typename iterator_traits<_InputIterator1>::value_type>)
__glibcpp_function_requires(_BinaryPredicateConcept<_Compare,
- typename iterator_traits<_InputIter1>::value_type,
- typename iterator_traits<_InputIter2>::value_type>)
+ typename iterator_traits<_InputIterator1>::value_type,
+ typename iterator_traits<_InputIterator2>::value_type>)
while (__first1 != __last1 && __first2 != __last2) {
if (__comp(*__first1, *__first2)) {
@@ -3719,22 +3723,22 @@ __result, __binary_pred, _IterType());
return copy(__first2, __last2, copy(__first1, __last1, __result));
}
- template
- _OutputIter
- set_intersection(_InputIter1 __first1, _InputIter1 __last1,
- _InputIter2 __first2, _InputIter2 __last2,
- _OutputIter __result)
+ template
+ _OutputIterator
+ set_intersection(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _InputIterator2 __last2,
+ _OutputIterator __result)
{
// concept requirements
- __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>)
- __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>)
- __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
- typename iterator_traits<_InputIter1>::value_type>)
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIterator1>)
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIterator2>)
+ __glibcpp_function_requires(_OutputIteratorConcept<_OutputIterator,
+ typename iterator_traits<_InputIterator1>::value_type>)
__glibcpp_function_requires(_SameTypeConcept<
- typename iterator_traits<_InputIter1>::value_type,
- typename iterator_traits<_InputIter2>::value_type>)
+ typename iterator_traits<_InputIterator1>::value_type,
+ typename iterator_traits<_InputIterator2>::value_type>)
__glibcpp_function_requires(_LessThanComparableConcept<
- typename iterator_traits<_InputIter1>::value_type>)
+ typename iterator_traits<_InputIterator1>::value_type>)
while (__first1 != __last1 && __first2 != __last2)
if (*__first1 < *__first2)
@@ -3750,24 +3754,24 @@ __result, __binary_pred, _IterType());
return __result;
}
- template
- _OutputIter
- set_intersection(_InputIter1 __first1, _InputIter1 __last1,
- _InputIter2 __first2, _InputIter2 __last2,
- _OutputIter __result, _Compare __comp)
+ _OutputIterator
+ set_intersection(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _InputIterator2 __last2,
+ _OutputIterator __result, _Compare __comp)
{
// concept requirements
- __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>)
- __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>)
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIterator1>)
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIterator2>)
__glibcpp_function_requires(_SameTypeConcept<
- typename iterator_traits<_InputIter1>::value_type,
- typename iterator_traits<_InputIter2>::value_type>)
- __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
- typename iterator_traits<_InputIter1>::value_type>)
+ typename iterator_traits<_InputIterator1>::value_type,
+ typename iterator_traits<_InputIterator2>::value_type>)
+ __glibcpp_function_requires(_OutputIteratorConcept<_OutputIterator,
+ typename iterator_traits<_InputIterator1>::value_type>)
__glibcpp_function_requires(_BinaryPredicateConcept<_Compare,
- typename iterator_traits<_InputIter1>::value_type,
- typename iterator_traits<_InputIter2>::value_type>)
+ typename iterator_traits<_InputIterator1>::value_type,
+ typename iterator_traits<_InputIterator2>::value_type>)
while (__first1 != __last1 && __first2 != __last2)
if (__comp(*__first1, *__first2))
@@ -3783,22 +3787,22 @@ __result, __binary_pred, _IterType());
return __result;
}
- template
- _OutputIter
- set_difference(_InputIter1 __first1, _InputIter1 __last1,
- _InputIter2 __first2, _InputIter2 __last2,
- _OutputIter __result)
+ template
+ _OutputIterator
+ set_difference(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _InputIterator2 __last2,
+ _OutputIterator __result)
{
// concept requirements
- __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>)
- __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>)
- __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
- typename iterator_traits<_InputIter1>::value_type>)
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIterator1>)
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIterator2>)
+ __glibcpp_function_requires(_OutputIteratorConcept<_OutputIterator,
+ typename iterator_traits<_InputIterator1>::value_type>)
__glibcpp_function_requires(_SameTypeConcept<
- typename iterator_traits<_InputIter1>::value_type,
- typename iterator_traits<_InputIter2>::value_type>)
+ typename iterator_traits<_InputIterator1>::value_type,
+ typename iterator_traits<_InputIterator2>::value_type>)
__glibcpp_function_requires(_LessThanComparableConcept<
- typename iterator_traits<_InputIter1>::value_type>)
+ typename iterator_traits<_InputIterator1>::value_type>)
while (__first1 != __last1 && __first2 != __last2)
if (*__first1 < *__first2) {
@@ -3815,24 +3819,24 @@ __result, __binary_pred, _IterType());
return copy(__first1, __last1, __result);
}
- template
- _OutputIter
- set_difference(_InputIter1 __first1, _InputIter1 __last1,
- _InputIter2 __first2, _InputIter2 __last2,
- _OutputIter __result, _Compare __comp)
+ _OutputIterator
+ set_difference(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _InputIterator2 __last2,
+ _OutputIterator __result, _Compare __comp)
{
// concept requirements
- __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>)
- __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>)
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIterator1>)
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIterator2>)
__glibcpp_function_requires(_SameTypeConcept<
- typename iterator_traits<_InputIter1>::value_type,
- typename iterator_traits<_InputIter2>::value_type>)
- __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
- typename iterator_traits<_InputIter1>::value_type>)
+ typename iterator_traits<_InputIterator1>::value_type,
+ typename iterator_traits<_InputIterator2>::value_type>)
+ __glibcpp_function_requires(_OutputIteratorConcept<_OutputIterator,
+ typename iterator_traits<_InputIterator1>::value_type>)
__glibcpp_function_requires(_BinaryPredicateConcept<_Compare,
- typename iterator_traits<_InputIter1>::value_type,
- typename iterator_traits<_InputIter2>::value_type>)
+ typename iterator_traits<_InputIterator1>::value_type,
+ typename iterator_traits<_InputIterator2>::value_type>)
while (__first1 != __last1 && __first2 != __last2)
if (__comp(*__first1, *__first2)) {
@@ -3849,22 +3853,22 @@ __result, __binary_pred, _IterType());
return copy(__first1, __last1, __result);
}
- template
- _OutputIter
- set_symmetric_difference(_InputIter1 __first1, _InputIter1 __last1,
- _InputIter2 __first2, _InputIter2 __last2,
- _OutputIter __result)
+ template
+ _OutputIterator
+ set_symmetric_difference(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _InputIterator2 __last2,
+ _OutputIterator __result)
{
// concept requirements
- __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>)
- __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>)
- __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
- typename iterator_traits<_InputIter1>::value_type>)
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIterator1>)
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIterator2>)
+ __glibcpp_function_requires(_OutputIteratorConcept<_OutputIterator,
+ typename iterator_traits<_InputIterator1>::value_type>)
__glibcpp_function_requires(_SameTypeConcept<
- typename iterator_traits<_InputIter1>::value_type,
- typename iterator_traits<_InputIter2>::value_type>)
+ typename iterator_traits<_InputIterator1>::value_type,
+ typename iterator_traits<_InputIterator2>::value_type>)
__glibcpp_function_requires(_LessThanComparableConcept<
- typename iterator_traits<_InputIter1>::value_type>)
+ typename iterator_traits<_InputIterator1>::value_type>)
while (__first1 != __last1 && __first2 != __last2)
if (*__first1 < *__first2) {
@@ -3884,25 +3888,25 @@ __result, __binary_pred, _IterType());
return copy(__first2, __last2, copy(__first1, __last1, __result));
}
- template
- _OutputIter
- set_symmetric_difference(_InputIter1 __first1, _InputIter1 __last1,
- _InputIter2 __first2, _InputIter2 __last2,
- _OutputIter __result,
+ _OutputIterator
+ set_symmetric_difference(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _InputIterator2 __last2,
+ _OutputIterator __result,
_Compare __comp)
{
// concept requirements
- __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>)
- __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>)
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIterator1>)
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIterator2>)
__glibcpp_function_requires(_SameTypeConcept<
- typename iterator_traits<_InputIter1>::value_type,
- typename iterator_traits<_InputIter2>::value_type>)
- __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
- typename iterator_traits<_InputIter1>::value_type>)
+ typename iterator_traits<_InputIterator1>::value_type,
+ typename iterator_traits<_InputIterator2>::value_type>)
+ __glibcpp_function_requires(_OutputIteratorConcept<_OutputIterator,
+ typename iterator_traits<_InputIterator1>::value_type>)
__glibcpp_function_requires(_BinaryPredicateConcept<_Compare,
- typename iterator_traits<_InputIter1>::value_type,
- typename iterator_traits<_InputIter2>::value_type>)
+ typename iterator_traits<_InputIterator1>::value_type,
+ typename iterator_traits<_InputIterator2>::value_type>)
while (__first1 != __last1 && __first2 != __last2)
if (__comp(*__first1, *__first2)) {
@@ -3925,71 +3929,71 @@ __result, __binary_pred, _IterType());
// min_element and max_element, with and without an explicitly supplied
// comparison function.
- template
- _ForwardIter
- max_element(_ForwardIter __first, _ForwardIter __last)
+ template