Non-Mutating Algorithms(3)

NAME
Non-Mutating Algorithms -

  Functions
template<typename _ForwardIterator , typename _BinaryPredicate > _ForwardIterator std::adjacent_find (_ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __binary_pred)
template<typename _ForwardIterator > _ForwardIterator std::adjacent_find (_ForwardIterator __first, _ForwardIterator __last)
template<typename _InputIterator , typename _Predicate > bool std::all_of (_InputIterator __first, _InputIterator __last, _Predicate __pred)
template<typename _InputIterator , typename _Predicate > bool std::any_of (_InputIterator __first, _InputIterator __last, _Predicate __pred)
template<typename _InputIterator , typename _Tp > iterator_traits< _InputIterator >::difference_type std::count (_InputIterator __first, _InputIterator __last, const _Tp &__value)
template<typename _InputIterator , typename _Predicate > iterator_traits< _InputIterator >::difference_type std::count_if (_InputIterator __first, _InputIterator __last, _Predicate __pred)
template<typename _IIter1 , typename _IIter2 , typename _BinaryPredicate > bool std::equal (_IIter1 __first1, _IIter1 __last1, _IIter2 __first2, _BinaryPredicate __binary_pred)
template<typename _II1 , typename _II2 > bool std::equal (_II1 __first1, _II1 __last1, _II2 __first2)
template<typename _InputIterator , typename _Tp > _InputIterator std::find (_InputIterator __first, _InputIterator __last, const _Tp &__val)
template<typename _ForwardIterator1 , typename _ForwardIterator2 , typename _BinaryPredicate > _ForwardIterator1 std::find_end (_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __comp)
template<typename _ForwardIterator1 , typename _ForwardIterator2 > _ForwardIterator1 std::find_end (_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2)
template<typename _InputIterator , typename _ForwardIterator , typename _BinaryPredicate > _InputIterator std::find_first_of (_InputIterator __first1, _InputIterator __last1, _ForwardIterator __first2, _ForwardIterator __last2, _BinaryPredicate __comp)
template<typename _InputIterator , typename _ForwardIterator > _InputIterator std::find_first_of (_InputIterator __first1, _InputIterator __last1, _ForwardIterator __first2, _ForwardIterator __last2)
template<typename _InputIterator , typename _Predicate > _InputIterator std::find_if (_InputIterator __first, _InputIterator __last, _Predicate __pred)
template<typename _InputIterator , typename _Predicate > _InputIterator std::find_if_not (_InputIterator __first, _InputIterator __last, _Predicate __pred)
template<typename _InputIterator , typename _Function > _Function std::for_each (_InputIterator __first, _InputIterator __last, _Function __f)
template<typename _InputIterator1 , typename _InputIterator2 , typename _BinaryPredicate > pair< _InputIterator1, _InputIterator2 > std::mismatch (_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _BinaryPredicate __binary_pred)
template<typename _InputIterator1 , typename _InputIterator2 > pair< _InputIterator1, _InputIterator2 > std::mismatch (_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2)
template<typename _InputIterator , typename _Predicate > bool std::none_of (_InputIterator __first, _InputIterator __last, _Predicate __pred)
template<typename _ForwardIterator1 , typename _ForwardIterator2 , typename _BinaryPredicate > _ForwardIterator1 std::search (_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __predicate)
template<typename _ForwardIterator1 , typename _ForwardIterator2 > _ForwardIterator1 std::search (_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2)
template<typename _ForwardIterator , typename _Integer , typename _Tp , typename _BinaryPredicate > _ForwardIterator std::search_n (_ForwardIterator __first, _ForwardIterator __last, _Integer __count, const _Tp &__val, _BinaryPredicate __binary_pred)
template<typename _ForwardIterator , typename _Integer , typename _Tp > _ForwardIterator std::search_n (_ForwardIterator __first, _ForwardIterator __last, _Integer __count, const _Tp &__val)

Function Documentation

  template<typename _ForwardIterator , typename _BinaryPredicate > _ForwardIterator std::adjacent_find (_ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __binary_pred) [inline]

Find two adjacent values in a sequence using a predicate.

Parameters:
    first A forward iterator.
    last A forward iterator.
    binary_pred A binary predicate.

Returns:
    The first iterator 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 4376 of file stl_algo.h.

  template<typename _ForwardIterator > _ForwardIterator std::adjacent_find (_ForwardIterator __first, _ForwardIterator __last) [inline]

Find two adjacent values in a sequence that are equal.

Parameters:
    first A forward iterator.
    last A forward iterator.

Returns:
    The first 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 4344 of file stl_algo.h.

  template<typename _InputIterator , typename _Predicate > bool std::all_of (_InputIterator __first, _InputIterator __last, _Predicate __pred) [inline]

Checks that a predicate is true for all the elements of a sequence.

Parameters:
    first An input iterator.
    last An input iterator.
    pred A predicate.

Returns:
    True if the check is true, false otherwise.

Returns true if pred is true for each element in the range [first,last), and false otherwise.

Definition at line 749 of file stl_algo.h.

References std::find_if_not().

  template<typename _InputIterator , typename _Predicate > 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.

Parameters:
    first An input iterator.
    last An input iterator.
    pred A predicate.

Returns:
    True if the check is true, false otherwise.

Returns true if an element exists in the range [first,last) such that pred is true, and false otherwise.

Definition at line 783 of file stl_algo.h.

References std::none_of().

  template<typename _InputIterator , typename _Tp > iterator_traits<_InputIterator>::difference_type std::count (_InputIterator __first, _InputIterator __last, const _Tp & __value) [inline]

Count the number of copies of a value in a sequence.

Parameters:
    first An input iterator.
    last An input iterator.
    value The value to be counted.

Returns:
    The number of iterators i in the range [first,last) for which *i == value

Definition at line 4408 of file stl_algo.h.

  template<typename _InputIterator , typename _Predicate > iterator_traits<_InputIterator>::difference_type std::count_if (_InputIterator __first, _InputIterator __last, _Predicate __pred) [inline]

Count the elements of a sequence for which a predicate is true.

Parameters:
    first An input iterator.
    last An input iterator.
    pred A predicate.

Returns:
    The number of iterators i in the range [first,last) for which pred(*i) is true.

Definition at line 4433 of file stl_algo.h.

  template<typename _IIter1 , typename _IIter2 , typename _BinaryPredicate > bool std::equal (_IIter1 __first1, _IIter1 __last1, _IIter2 __first2, _BinaryPredicate __binary_pred) [inline]

Tests a range for element-wise equality.

Parameters:
    first1 An input iterator.
    last1 An input iterator.
    first2 An input iterator.
    binary_pred A binary predicate functor.

Returns:
    A boolean true or false.

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 989 of file stl_algobase.h.

  template<typename _II1 , typename _II2 > bool std::equal (_II1 __first1, _II1 __last1, _II2 __first2) [inline]

Tests a range for element-wise equality.

Parameters:
    first1 An input iterator.
    last1 An input iterator.
    first2 An input iterator.

Returns:
    A boolean true or false.

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 957 of file stl_algobase.h.

Referenced by std::operator==().

  template<typename _InputIterator , typename _Tp > _InputIterator std::find (_InputIterator __first, _InputIterator __last, const _Tp & __val) [inline]

Find the first occurrence of a value in a sequence.

Parameters:
    first An input iterator.
    last An input iterator.
    val The value to find.

Returns:
    The first iterator i in the range [first,last) such that *i == val, or last if no such iterator exists.

Definition at line 4220 of file stl_algo.h.

References std::__find(), and std::__iterator_category().

  template<typename _ForwardIterator1 , typename _ForwardIterator2 , typename _BinaryPredicate > _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.

Parameters:
    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.

Returns:
    The last iterator 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 715 of file stl_algo.h.

References std::__iterator_category().

  template<typename _ForwardIterator1 , typename _ForwardIterator2 > _ForwardIterator1 std::find_end (_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2) [inline]

Find last matching subsequence in a sequence.

Parameters:
    first1 Start of range to search.
    last1 End of range to search.
    first2 Start of sequence to match.
    last2 End of sequence to match.

Returns:
    The last 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. 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 668 of file stl_algo.h.

References std::__iterator_category().

  template<typename _InputIterator , typename _ForwardIterator , typename _BinaryPredicate > _InputIterator std::find_first_of (_InputIterator __first1, _InputIterator __last1, _ForwardIterator __first2, _ForwardIterator __last2, _BinaryPredicate __comp) [inline]

Find element from a set in a sequence using a predicate.

Parameters:
    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.

Returns:
    The first iterator 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 4313 of file stl_algo.h.

  template<typename _InputIterator , typename _ForwardIterator > _InputIterator std::find_first_of (_InputIterator __first1, _InputIterator __last1, _ForwardIterator __first2, _ForwardIterator __last2) [inline]

Find element from a set in a sequence.

Parameters:
    first1 Start of range to search.
    last1 End of range to search.
    first2 Start of match candidates.
    last2 End of match candidates.

Returns:
    The first iterator 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 4273 of file stl_algo.h.

  template<typename _InputIterator , typename _Predicate > _InputIterator std::find_if (_InputIterator __first, _InputIterator __last, _Predicate __pred) [inline]

Find the first element in a sequence for which a predicate is true.

Parameters:
    first An input iterator.
    last An input iterator.
    pred A predicate.

Returns:
    The first iterator i in the range [first,last) such that pred(*i) is true, or last if no such iterator exists.

Definition at line 4244 of file stl_algo.h.

References std::__find_if(), and std::__iterator_category().

  template<typename _InputIterator , typename _Predicate > _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.

Parameters:
    first An input iterator.
    last An input iterator.
    pred A predicate.

Returns:
    The first iterator i in the range [first,last) such that pred(*i) is false, or last if no such iterator exists.

Definition at line 798 of file stl_algo.h.

References std::__find_if_not(), and std::__iterator_category().

Referenced by std::all_of(), and std::is_partitioned().

  template<typename _InputIterator , typename _Function > _Function std::for_each (_InputIterator __first, _InputIterator __last, _Function __f) [inline]

Apply a function to every element of a sequence.

Parameters:
    first An input iterator.
    last An input iterator.
    f A unary function object.

Returns:
    f.

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 4199 of file stl_algo.h.

  template<typename _InputIterator1 , typename _InputIterator2 , typename _BinaryPredicate > pair<_InputIterator1, _InputIterator2> std::mismatch (_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _BinaryPredicate __binary_pred) [inline]

Finds the places in ranges which don't match.

Parameters:
    first1 An input iterator.
    last1 An input iterator.
    first2 An input iterator.
    binary_pred A binary predicate functor.

Returns:
    A pair of iterators pointing to the first mismatch.

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 1133 of file stl_algobase.h.

  template<typename _InputIterator1 , typename _InputIterator2 > pair<_InputIterator1, _InputIterator2> std::mismatch (_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2) [inline]

Finds the places in ranges which don't match.

Parameters:
    first1 An input iterator.
    last1 An input iterator.
    first2 An input iterator.

Returns:
    A pair of iterators pointing to the first mismatch.

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 1095 of file stl_algobase.h.

  template<typename _InputIterator , typename _Predicate > bool std::none_of (_InputIterator __first, _InputIterator __last, _Predicate __pred) [inline]

Checks that a predicate is false for all the elements of a sequence.

Parameters:
    first An input iterator.
    last An input iterator.
    pred A predicate.

Returns:
    True if the check is true, false otherwise.

Returns true if pred is false for each element in the range [first,last), and false otherwise.

Definition at line 766 of file stl_algo.h.

Referenced by std::any_of(), and std::is_partitioned().

  template<typename _ForwardIterator1 , typename _ForwardIterator2 , typename _BinaryPredicate > _ForwardIterator1 std::search (_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __predicate) [inline]

Search a sequence for a matching sub-sequence using a predicate.

Parameters:
    first1 A forward iterator.
    last1 A forward iterator.
    first2 A forward iterator.
    last2 A forward iterator.
    predicate A binary predicate.

Returns:
    The first iterator 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.

See also:
    search(_ForwardIter1, _ForwardIter1, _ForwardIter2, _ForwardIter2)

Definition at line 4545 of file stl_algo.h.

  template<typename _ForwardIterator1 , typename _ForwardIterator2 > _ForwardIterator1 std::search (_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2) [inline]

Search a sequence for a matching sub-sequence.

Parameters:
    first1 A forward iterator.
    last1 A forward iterator.
    first2 A forward iterator.
    last2 A forward iterator.

Returns:
    The first 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 4473 of file stl_algo.h.

  template<typename _ForwardIterator , typename _Integer , typename _Tp , typename _BinaryPredicate > _ForwardIterator std::search_n (_ForwardIterator __first, _ForwardIterator __last, _Integer __count, const _Tp & __val, _BinaryPredicate __binary_pred) [inline]

Search a sequence for a number of consecutive values using a predicate.

Parameters:
    first A forward iterator.
    last A forward iterator.
    count The number of consecutive values.
    val The value to find.
    binary_pred A binary predicate.

Returns:
    The first iterator 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 4655 of file stl_algo.h.

References std::__iterator_category(), and std::__search_n().

  template<typename _ForwardIterator , typename _Integer , typename _Tp > _ForwardIterator std::search_n (_ForwardIterator __first, _ForwardIterator __last, _Integer __count, const _Tp & __val) [inline]

Search a sequence for a number of consecutive values.

Parameters:
    first A forward iterator.
    last A forward iterator.
    count The number of consecutive values.
    val The value to find.

Returns:
    The first iterator 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 4618 of file stl_algo.h.

References std::__iterator_category(), and std::__search_n().

Author

Generated automatically by Doxygen for libstdc++ from the source code.