STL Elements in C++: Function objects, Predicate, headers and

Function objects: Function objects predefined functions in the header <functional> which are used in place of a function pointer. Types of function objects: plus, minus, multiplies, divides, modulus, less, less_equal, logical_and, logical_or, logical_not, negate, equal_to, not_equal_to, greater greater_equal.

Predicate: A predicate is a special function in a container that returns a true or a false result. It can be unary (for one argument) or binary (for two arguments).

Headers: There are two headers in STL: <utility> and <functional>

Leave a Reply