Partager via


find_if_not

Returns the first element in the indicated range that does not satisfy a condition.

template<class InputIterator, class Predicate>
    InputIterator find_if_not(
        InputIterator _First, 
        InputIterator _Last,
        BinaryPredicate _Comp
    );

Parameters

  • _First
    An input iterator that indicates the start of a range to check for a condition.

  • _Last
    An input iterator that indicates the end of a range.

  • _Comp
    The condition to test for. This is provided by a user-defined predicate function object that defines the condition to be satisfied by the element being searched for. A predicate takes a single argument and returns true or false.

Return Value

Returns an iterator that points to the first element found to fail the condition tested for by using _Comp. Returns _Last if no such element is found.

Remarks

The template function determines the lowest value of N in the range [0, _Last - _First) for which the predicate _Comp(*(_First + N)) is false. It then returns _First + N. If no such value exists, the function returns _Last. It evaluates the predicate one time at most for each N.

Requirements

Header: <algorithm>

Namespace: std

See Also

Reference

Standard Template Library

Other Resources

<algorithm> Members