SGI Logo


Category: functors Component type: concept


A Predicate is a Unary Function whose result represents the truth or falsehood of some condition. A Predicate might, for example, be a function that takes an argument of type int and returns true if the argument is positive.

Refinement of

Unary Function

Associated types

Result type The type returned when the Predicate is called. The result type must be convertible to bool.


F A type that is a model of Predicate
X The argument type of F
f Object of type F
x Object of type X

Valid expressions

Name Expression Type requirements Return type
Function call f(x)   Convertible to bool

Expression semantics

Name Expression Precondition Semantics Postcondition
Function call f(x) x is in the domain of f. Returns true if the condition is satisfied, false if it is not. The result is either true or false.

Complexity guarantees




See also

Adaptable Predicate, Binary Predicate, Adaptable Binary Predicate

STL Main Page

Contact Us | Site Map | Trademarks | Privacy | Using this site means you accept its Terms of Use
Copyright © 2009 - 2014 Silicon Graphics International. All rights reserved.