libstdc++
|
_ForwardIterator std::adjacent_find | ( | _ForwardIterator | __first, |
_ForwardIterator | __last | ||
) |
Find two adjacent values in a sequence that are equal.
<strong>first | A forward iterator. |
__last | A forward iterator. |
i
such that i
and i+1
are both valid iterators in
[__first,last) and such that *i
== *
(i+1), or __last
if no such iterator exists. Definition at line 4540 of file stl_algo.h.
_ForwardIterator std::adjacent_find | ( | _ForwardIterator | __first, |
_ForwardIterator | __last, | ||
_BinaryPredicate | __binary_pred | ||
) |
Find two adjacent values in a sequence using a predicate.
<strong>first | A forward iterator. |
__last | A forward iterator. |
__binary_pred | A binary predicate. |
i
such that i
and i+1
are both valid iterators in
[__first,last) and such that __binary_pred
(i,(i+1)) is true, or __last
if no such iterator exists. Definition at line 4572 of file stl_algo.h.
bool std::all_of | ( | _InputIterator | __first, |
_InputIterator | __last, | ||
_Predicate | __pred | ||
) | [inline] |
Checks that a predicate is true for all the elements of a sequence.
__first | An input iterator. |
__last | An input iterator. |
__pred | A predicate. |
Returns true if pred
is true for each element in the range [__first,last), and false otherwise.
Definition at line 734 of file stl_algo.h.
References std::find_if_not().
bool std::any_of | ( | _InputIterator | __first, |
_InputIterator | __last, | ||
_Predicate | __pred | ||
) | [inline] |
Checks that a predicate is false for at least an element of a sequence.
__first | An input iterator. |
__last | An input iterator. |
__pred | A predicate. |
Returns true if an element exists in the range [first,last) such that
__pred
is true, and false otherwise.
Definition at line 769 of file stl_algo.h.
References std::none_of().
iterator_traits<_InputIterator>::difference_type std::count | ( | _InputIterator | __first, |
_InputIterator | __last, | ||
const _Tp & | __value | ||
) |
Count the number of copies of a value in a sequence.
<strong>first | An input iterator. |
__last | An input iterator. |
__value | The value to be counted. |
i
in the range
[__first,last) for which *i
== __value
Definition at line 4604 of file stl_algo.h.
iterator_traits<_InputIterator>::difference_type std::count_if | ( | _InputIterator | __first, |
_InputIterator | __last, | ||
_Predicate | __pred | ||
) |
Count the elements of a sequence for which a predicate is true.
<strong>first | An input iterator. |
__last | An input iterator. |
__pred | A predicate. |
i
in the range
[__first,last) for which __pred(*i)
is true. Definition at line 4629 of file stl_algo.h.
Referenced by std::is_permutation().
bool std::equal | ( | _IIter1 | __first1, |
_IIter1 | __last1, | ||
_IIter2 | __first2, | ||
_BinaryPredicate | __binary_pred | ||
) | [inline] |
Tests a range for element-wise equality.
__first1 | An input iterator. |
__last1 | An input iterator. |
__first2 | An input iterator. |
__binary_pred | A binary predicate functor. |
This compares the elements of two ranges using the binary_pred parameter, and returns true or false depending on whether all of the corresponding elements of the ranges are equal.
Definition at line 1043 of file stl_algobase.h.
bool std::equal | ( | _II1 | __first1, |
_II1 | __last1, | ||
_II2 | __first2 | ||
) | [inline] |
Tests a range for element-wise equality.
__first1 | An input iterator. |
__last1 | An input iterator. |
__first2 | An input iterator. |
This compares the elements of two ranges using ==
and returns true or false depending on whether all of the corresponding elements of the ranges are equal.
Definition at line 1011 of file stl_algobase.h.
Referenced by std::operator==().
_InputIterator std::find | ( | _InputIterator | __first, |
_InputIterator | __last, | ||
const _Tp & | __val | ||
) | [inline] |
Find the first occurrence of a value in a sequence.
<strong>first | An input iterator. |
__last | An input iterator. |
__val | The value to find. |
i
in the range
[__first,last) such that *i
== __val
, or __last
if no such iterator exists. Definition at line 4414 of file stl_algo.h.
References std::__find(), and std::__iterator_category().
_ForwardIterator1 std::find_end | ( | _ForwardIterator1 | __first1, |
_ForwardIterator1 | __last1, | ||
_ForwardIterator2 | __first2, | ||
_ForwardIterator2 | __last2 | ||
) | [inline] |
Find last matching subsequence in a sequence.
<strong>first1 | Start of range to search. |
__last1 | End of range to search. |
__first2 | Start of sequence to match. |
__last2 | End of sequence to match. |
i
in the range
[__first1,last1-(last2-__first2)) such that *
(i+N) == *
(__first2+N) for each N
in the range
[0,last2-__first2), or __last1
if no such iterator exists.Searches the range [first1,last1) for a sub-sequence that compares equal value-by-value with the sequence given by
[first2,last2) and returns an iterator to the first element of the sub-sequence, or
__last1
if the sub-sequence is not found. The sub-sequence will be the last such subsequence contained in [__first,last1).
Because the sub-sequence must lie completely within the range [first1,last1) it must start at a position less than
last1-
(__last2-__first2) where __last2-__first2
is the length of the sub-sequence. This means that the returned iterator i
will be in the range [__first1,last1-(__last2-__first2))
Definition at line 652 of file stl_algo.h.
References std::__iterator_category().
_ForwardIterator1 std::find_end | ( | _ForwardIterator1 | __first1, |
_ForwardIterator1 | __last1, | ||
_ForwardIterator2 | __first2, | ||
_ForwardIterator2 | __last2, | ||
_BinaryPredicate | __comp | ||
) | [inline] |
Find last matching subsequence in a sequence using a predicate.
<strong>first1 | Start of range to search. |
__last1 | End of range to search. |
__first2 | Start of sequence to match. |
__last2 | End of sequence to match. |
__comp | The predicate to use. |
i
in the range
[__first1,last1-(last2-__first2)) such that predicate
(*(i+N),
(__first2+N)) is true for each N
in the range
[0,last2-__first2), or __last1
if no such iterator exists.Searches the range [first1,last1) for a sub-sequence that compares equal value-by-value with the sequence given by
[first2,last2) using comp as a predicate and returns an iterator to the first element of the sub-sequence, or
last1
if the sub-sequence is not found. The sub-sequence will be the last such subsequence contained in [__first,last1).
Because the sub-sequence must lie completely within the range [first1,last1) it must start at a position less than
last1-
(__last2-__first2) where __last2-__first2
is the length of the sub-sequence. This means that the returned iterator i
will be in the range [__first1,last1-(__last2-__first2))
Definition at line 700 of file stl_algo.h.
References std::__iterator_category().
_InputIterator std::find_first_of | ( | _InputIterator | __first1, |
_InputIterator | __last1, | ||
_ForwardIterator | __first2, | ||
_ForwardIterator | __last2 | ||
) |
Find element from a set in a sequence.
<strong>first1 | Start of range to search. |
__last1 | End of range to search. |
__first2 | Start of match candidates. |
__last2 | End of match candidates. |
i
in the range
[__first1,last1) such that *i
== *
(i2) such that i2 is an iterator in [first2,last2), or __last1
if no such iterator exists.Searches the range [first1,last1) for an element that is equal to some element in the range [first2,last2). If found, returns an iterator in the range [first1,last1), otherwise returns
__last1
.
Definition at line 4468 of file stl_algo.h.
_InputIterator std::find_first_of | ( | _InputIterator | __first1, |
_InputIterator | __last1, | ||
_ForwardIterator | __first2, | ||
_ForwardIterator | __last2, | ||
_BinaryPredicate | __comp | ||
) |
Find element from a set in a sequence using a predicate.
<strong>first1 | Start of range to search. |
__last1 | End of range to search. |
__first2 | Start of match candidates. |
__last2 | End of match candidates. |
__comp | Predicate to use. |
i
in the range
[__first1,last1) such that comp
(*i, *
(i2)) is true and i2 is an iterator in [first2,last2), or __last1
if no such iterator exists.Searches the range [first1,last1) for an element that is equal to some element in the range [first2,last2). If found, returns an iterator in the range [first1,last1), otherwise returns
__last1
.
Definition at line 4509 of file stl_algo.h.
_InputIterator std::find_if | ( | _InputIterator | __first, |
_InputIterator | __last, | ||
_Predicate | __pred | ||
) | [inline] |
Find the first element in a sequence for which a predicate is true.
<strong>first | An input iterator. |
__last | An input iterator. |
__pred | A predicate. |
i
in the range
[__first,last) such that __pred(*i)
is true, or __last
if no such iterator exists. Definition at line 4438 of file stl_algo.h.
References std::__find_if(), and std::__iterator_category().
_InputIterator std::find_if_not | ( | _InputIterator | __first, |
_InputIterator | __last, | ||
_Predicate | __pred | ||
) | [inline] |
Find the first element in a sequence for which a predicate is false.
<strong>first | An input iterator. |
__last | An input iterator. |
__pred | A predicate. |
i
in the range
[__first,last) such that __pred(*i)
is false, or __last
if no such iterator exists. Definition at line 784 of file stl_algo.h.
References std::__find_if_not(), and std::__iterator_category().
Referenced by std::all_of(), and std::is_partitioned().
_Function std::for_each | ( | _InputIterator | __first, |
_InputIterator | __last, | ||
_Function | __f | ||
) |
Apply a function to every element of a sequence.
__first | An input iterator. |
__last | An input iterator. |
__f | A unary function object. |
__f
(std::move(__f
) in C++0x).Applies the function object __f
to each element in the range [first,last).
__f
must not modify the order of the sequence. If __f
has a return value it is ignored.
Definition at line 4393 of file stl_algo.h.
bool std::is_permutation | ( | _ForwardIterator1 | __first1, |
_ForwardIterator1 | __last1, | ||
_ForwardIterator2 | __first2 | ||
) |
Checks whether a permutaion of the second sequence is equal to the first sequence.
__first1 | Start of first range. |
__last1 | End of first range. |
__first2 | Start of second range. |
Definition at line 4253 of file stl_algo.h.
References std::advance(), std::count(), and std::distance().
bool std::is_permutation | ( | _ForwardIterator1 | __first1, |
_ForwardIterator1 | __last1, | ||
_ForwardIterator2 | __first2, | ||
_BinaryPredicate | __pred | ||
) |
Checks whether a permutation of the second sequence is equal to the first sequence.
__first1 | Start of first range. |
__last1 | End of first range. |
__first2 | Start of second range. |
__pred | A binary predicate. |
Definition at line 4299 of file stl_algo.h.
References std::advance(), std::bind(), std::count_if(), and std::distance().
pair<_InputIterator1, _InputIterator2> std::mismatch | ( | _InputIterator1 | __first1, |
_InputIterator1 | __last1, | ||
_InputIterator2 | __first2 | ||
) |
Finds the places in ranges which don't match.
__first1 | An input iterator. |
__last1 | An input iterator. |
__first2 | An input iterator. |
This compares the elements of two ranges using ==
and returns a pair of iterators. The first iterator points into the first range, the second iterator points into the second range, and the elements pointed to by the iterators are not equal.
Definition at line 1148 of file stl_algobase.h.
pair<_InputIterator1, _InputIterator2> std::mismatch | ( | _InputIterator1 | __first1, |
_InputIterator1 | __last1, | ||
_InputIterator2 | __first2, | ||
_BinaryPredicate | __binary_pred | ||
) |
Finds the places in ranges which don't match.
__first1 | An input iterator. |
__last1 | An input iterator. |
__first2 | An input iterator. |
__binary_pred | A binary predicate functor. |
This compares the elements of two ranges using the binary_pred parameter, and returns a pair of iterators. The first iterator points into the first range, the second iterator points into the second range, and the elements pointed to by the iterators are not equal.
Definition at line 1186 of file stl_algobase.h.
bool std::none_of | ( | _InputIterator | __first, |
_InputIterator | __last, | ||
_Predicate | __pred | ||
) | [inline] |
Checks that a predicate is false for all the elements of a sequence.
__first | An input iterator. |
__last | An input iterator. |
__pred | A predicate. |
Returns true if pred
is false for each element in the range [__first,last), and false otherwise.
Definition at line 751 of file stl_algo.h.
Referenced by std::any_of(), and std::is_partitioned().
_ForwardIterator1 std::search | ( | _ForwardIterator1 | __first1, |
_ForwardIterator1 | __last1, | ||
_ForwardIterator2 | __first2, | ||
_ForwardIterator2 | __last2 | ||
) |
Search a sequence for a matching sub-sequence.
<strong>first1 | A forward iterator. |
__last1 | A forward iterator. |
__first2 | A forward iterator. |
__last2 | A forward iterator. |
i
in the range
[__first1,last1-(last2-__first2)) such that *
(i+N) == *
(__first2+N) for each N
in the range
[0,last2-__first2), or __last1
if no such iterator exists.Searches the range [first1,last1) for a sub-sequence that compares equal value-by-value with the sequence given by
[first2,last2) and returns an iterator to the first element of the sub-sequence, or
__last1
if the sub-sequence is not found.
Because the sub-sequence must lie completely within the range [first1,last1) it must start at a position less than
__last1-
(__last2-__first2) where __last2-__first2
is the length of the sub-sequence.
This means that the returned iterator i
will be in the range [first1,last1-(__last2-__first2))
Definition at line 4671 of file stl_algo.h.
_ForwardIterator1 std::search | ( | _ForwardIterator1 | __first1, |
_ForwardIterator1 | __last1, | ||
_ForwardIterator2 | __first2, | ||
_ForwardIterator2 | __last2, | ||
_BinaryPredicate | __predicate | ||
) |
Search a sequence for a matching sub-sequence using a predicate.
<strong>first1 | A forward iterator. |
__last1 | A forward iterator. |
__first2 | A forward iterator. |
__last2 | A forward iterator. |
__predicate | A binary predicate. |
i
in the range
[__first1,last1-(last2-__first2)) such that __predicate
(*(i+N),*(__first2+N)) is true for each N
in the range
[0,last2-__first2), or __last1
if no such iterator exists.Searches the range [first1,last1) for a sub-sequence that compares equal value-by-value with the sequence given by
[first2,last2), using
__predicate
to determine equality, and returns an iterator to the first element of the sub-sequence, or __last1
if no such iterator exists.
Definition at line 4743 of file stl_algo.h.
_ForwardIterator std::search_n | ( | _ForwardIterator | __first, |
_ForwardIterator | __last, | ||
_Integer | __count, | ||
const _Tp & | __val | ||
) |
Search a sequence for a number of consecutive values.
<strong>first | A forward iterator. |
__last | A forward iterator. |
__count | The number of consecutive values. |
__val | The value to find. |
i
in the range
[__first,last-__count) such that *
(i+N) == val
for each N
in the range
[0,count), or __last
if no such iterator exists.Searches the range [first,last) for
count
consecutive elements equal to __val
.
Definition at line 4817 of file stl_algo.h.
References std::__iterator_category(), and std::__search_n().
_ForwardIterator std::search_n | ( | _ForwardIterator | __first, |
_ForwardIterator | __last, | ||
_Integer | __count, | ||
const _Tp & | __val, | ||
_BinaryPredicate | __binary_pred | ||
) |
Search a sequence for a number of consecutive values using a predicate.
<strong>first | A forward iterator. |
__last | A forward iterator. |
__count | The number of consecutive values. |
__val | The value to find. |
__binary_pred | A binary predicate. |
i
in the range
[__first,last-__count) such that binary_pred
(*(i+N),val) is true for each N
in the range
[0,__count), or __last
if no such iterator exists.Searches the range [first,last) for
__count
consecutive elements for which the predicate returns true.
Definition at line 4855 of file stl_algo.h.
References std::__iterator_category(), and std::__search_n().