##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# C++ concepts: Predicate

From cppreference.com
< cpp‎ | concept

The `Predicate` concept describes a function object that takes a single iterator argument that is dereferenced and used to return a value testable as a bool.

In other words, if an algorithm takes a `Predicate pred` and an iterator `first`, it should be able to test the iterator using the predicate via a construct like if (pred(*first)) {...}.

The function object `pred` shall not apply any non-constant function through the dereferenced iterator. This function object may be a pointer to function or an object of a type with an appropriate function call operator.

### [edit] Requirements

- `Callable`

| This section is incomplete Reason: better describe actual requirements

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=cpp/concept/Predicate&oldid=67102"
Category:

- Todo with reason