Noeud:Standard Function Objects, Noeud « Next »:, Noeud « Up »:Function Object Summary



Standard Function Objects

Other than the function objects that we considered in Some Predefined Function Objects, STL provides a number of different predefined function objects. Since they're fairly intuitive to use (as you've seen in Function Objects - in a Nutshell), they do not require much explanation (names like multiplies and divide are self-explanatory).

Name Description Unary/binary Operator
plus Returns the sum of the two operands passed to it binary +
minus Returns the sum of subtracting the second operand from the first binary -
multiplies Returns the product of the two operands passed to it binary *
divides Returns the result of dividing the second operand from the first binary /
modulus Returns the result of applying the modulus operator to the two operands. binary %
negate Returns the negated value of the operand passed to it unary -
equal_to Returns true if the two parameters are equal binary ==
not_equal_to Returns true if the two parameters are not equal binary !=
greater Returns true if the first parameter is greater than the second binary >
less Returns true if the first parameter is less than the second binary <
greater_equal Returns true if the first parameter is greater than or equal to the second binary >=
less_equal Returns true if the first parameter is less than or equal to the second binary <=
logical_and Returns the result of and-ing the two parameters passed to it binary &&
logical_or Returns the result of or-ing the two parameters passed to it binary ||
logical_not Returns the result of not-ting the parameter passed in binary !