All Classes Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Function objects submodule

Provides function objects to use. More...

Variables

constexpr plus_type gears::functional::plus {}
 Function object performing addition. More...
 
constexpr minus_type gears::functional::minus {}
 Function object performing subtraction. More...
 
constexpr multiplies_type gears::functional::multiplies {}
 Function object performing multiplication. More...
 
constexpr divides_type gears::functional::divides {}
 Function object performing division. More...
 
constexpr modulus_type gears::functional::modulus {}
 Function object performing modulus. More...
 
constexpr bit_and_type gears::functional::bit_and {}
 Function object performing bitwise and. More...
 
constexpr bit_or_type gears::functional::bit_or {}
 Function object performing bitwise or. More...
 
constexpr bit_xor_type gears::functional::bit_xor {}
 Function object performing bitwise xor. More...
 
constexpr bit_not_type gears::functional::bit_not {}
 Function object performing bitwise not. More...
 
constexpr lshift_type gears::functional::lshift {}
 Function object performing bitwise left shift. More...
 
constexpr rshift_type gears::functional::rshift {}
 Function object performing bitwise right shift. More...
 
constexpr equal_to_type gears::functional::equal_to {}
 Function object performing equality comparison. More...
 
constexpr not_equal_to_type gears::functional::not_equal_to {}
 Function object performing inequality comparison. More...
 
constexpr greater_type gears::functional::greater {}
 Function object performing greater than comparison. More...
 
constexpr less_type gears::functional::less {}
 Function object performing less than comparison. More...
 
constexpr greater_equal_type gears::functional::greater_equal {}
 Function object performing greater than or equal comparison. More...
 
constexpr less_equal_type gears::functional::less_equal {}
 Function object performing less than or equal comparison. More...
 
constexpr logical_and_type gears::functional::logical_and {}
 Function object performing logical and. More...
 
constexpr logical_or_type gears::functional::logical_or {}
 Function object performing logical or. More...
 
constexpr logical_not_type gears::functional::logical_not {}
 Function object performing logical not. More...
 
constexpr even_type gears::functional::even {}
 Function object checking if a numeric type is even. More...
 
constexpr odd_type gears::functional::odd {}
 Function object checking if a numeric type is odd. More...
 

Detailed Description

A function object is any object for which the function call operator is defined. An instance of a function object could be called just like a regular function and could emulate functions as first class citizens.

Variable Documentation

constexpr bit_and_type gears::functional::bit_and {}

Effectively calls operator& on two variables in a generic manner. This is an instance of a function object and could be called just like a regular function.

Parameters
tleft parameter to bit and
uright parameter to bit and
Returns
the generic result of t & u

Definition at line 84 of file bitwise_operators.hpp.

constexpr bit_not_type gears::functional::bit_not {}

Effectively calls operator~ on a variable in a generic manner. This is an instance of a function object and could be called just like a regular function.

Parameters
tparameter to bit not
Returns
the generic result of ~t

Definition at line 128 of file bitwise_operators.hpp.

constexpr bit_or_type gears::functional::bit_or {}

Effectively calls operator| on two variables in a generic manner. This is an instance of a function object and could be called just like a regular function.

Parameters
tleft parameter to bit or
uright parameter to bit or
Returns
the generic result of t | u

Definition at line 99 of file bitwise_operators.hpp.

constexpr bit_xor_type gears::functional::bit_xor {}

Effectively calls operator^ on two variables in a generic manner. This is an instance of a function object and could be called just like a regular function.

Parameters
tleft parameter to xor
uright parameter to xor
Returns
the generic result of t ^ u

Definition at line 114 of file bitwise_operators.hpp.

constexpr divides_type gears::functional::divides {}

Effectively calls operator/ on two variables in a generic manner. This is an instance of a function object and could be called just like a regular function.

Parameters
tleft parameter to divide
uright parameter to divide
Returns
the generic result of t / u

Definition at line 118 of file arithmetic_operators.hpp.

constexpr equal_to_type gears::functional::equal_to {}

Effectively calls operator== on two variables in a generic manner. This is an instance of a function object and could be called just like a regular function.

Parameters
tleft side to compare
uright side to compare
Returns
the generic result of t == u

Definition at line 83 of file comparison_operators.hpp.

constexpr even_type gears::functional::even {}

Checks if a numeric instance is even by effectively checking if t % 2 == 0.

Parameters
tnumeric type to check
Returns
generic result of t % 2 == 0, usually bool.

Definition at line 53 of file numeric_properties.hpp.

constexpr greater_type gears::functional::greater {}

Effectively calls operator> on two variables in a generic manner. This is an instance of a function object and could be called just like a regular function.

Parameters
tleft side to compare
uright side to compare
Returns
the generic result of t > u

Definition at line 111 of file comparison_operators.hpp.

constexpr greater_equal_type gears::functional::greater_equal {}

Effectively calls operator>= on two variables in a generic manner. This is an instance of a function object and could be called just like a regular function.

Parameters
tleft side to compare
uright side to compare
Returns
the generic result of t >= u

Definition at line 139 of file comparison_operators.hpp.

constexpr less_type gears::functional::less {}

Effectively calls operator< on two variables in a generic manner. This is an instance of a function object and could be called just like a regular function.

Parameters
tleft side to compare
uright side to compare
Returns
the generic result of t < u

Definition at line 125 of file comparison_operators.hpp.

constexpr less_equal_type gears::functional::less_equal {}

Effectively calls operator<= on two variables in a generic manner. This is an instance of a function object and could be called just like a regular function.

Parameters
tleft side to compare
uright side to compare
Returns
the generic result of t <= u

Definition at line 153 of file comparison_operators.hpp.

constexpr logical_and_type gears::functional::logical_and {}

Effectively calls operator&& on two variables in a generic manner. This is an instance of a function object and could be called just like a regular function.

Note that this does not short circuit.

Parameters
tleft side to check
uright side to check
Returns
the generic result of t && u

Definition at line 64 of file logical_operators.hpp.

constexpr logical_not_type gears::functional::logical_not {}

Effectively calls operator! on a variable in a generic manner. This is an instance of a function object and could be called just like a regular function.

Parameters
tobject to logically negate
Returns
the generic result of !t

Definition at line 93 of file logical_operators.hpp.

constexpr logical_or_type gears::functional::logical_or {}

Effectively calls operator|| on two variables in a generic manner. This is an instance of a function object and could be called just like a regular function.

Note that this does not short circuit.

Parameters
tleft side to check
uright side to check
Returns
the generic result of t || u

Definition at line 80 of file logical_operators.hpp.

constexpr lshift_type gears::functional::lshift {}

Effectively calls operator<< on two variables in a generic manner. This is an instance of a function object and could be called just like a regular function.

Parameters
tleft parameter to left shift
uright parameter to left shift
Returns
the generic result of t << u

Definition at line 143 of file bitwise_operators.hpp.

constexpr minus_type gears::functional::minus {}

Effectively calls operator- on two variables in a generic manner. This is an instance of a function object and could be called just like a regular function.

Parameters
tleft parameter to subtract
uright parameter to subtract
Returns
the generic result of t - u

Definition at line 90 of file arithmetic_operators.hpp.

constexpr modulus_type gears::functional::modulus {}

Effectively calls operator% on two variables in a generic manner. This is an instance of a function object and could be called just like a regular function.

Parameters
tleft parameter to mod
uright parameter to mod
Returns
the generic result of t % u

Definition at line 132 of file arithmetic_operators.hpp.

constexpr multiplies_type gears::functional::multiplies {}

Effectively calls operator* on two variables in a generic manner. This is an instance of a function object and could be called just like a regular function.

Parameters
tleft parameter to multiply
uright parameter to multiply
Returns
the generic result of t * u

Definition at line 104 of file arithmetic_operators.hpp.

constexpr not_equal_to_type gears::functional::not_equal_to {}

Effectively calls operator!= on two variables in a generic manner. This is an instance of a function object and could be called just like a regular function.

Parameters
tleft side to compare
uright side to compare
Returns
the generic result of t != u

Definition at line 97 of file comparison_operators.hpp.

constexpr odd_type gears::functional::odd {}

Checks if a numeric instance is odd by effectively checking if t % 2 != 0.

Parameters
tnumeric type to check
Returns
generic result of t % 2 != 0, usually bool.

Definition at line 65 of file numeric_properties.hpp.

constexpr plus_type gears::functional::plus {}

Effectively calls operator+ on two variables in a generic manner. This is an instance of a function object and could be called just like a regular function.

Parameters
tleft parameter to add
uright parameter to add
Returns
the generic result of t + u

Definition at line 76 of file arithmetic_operators.hpp.

constexpr rshift_type gears::functional::rshift {}

Effectively calls operator>> on two variables in a generic manner. This is an instance of a function object and could be called just like a regular function.

Parameters
tleft parameter to right shift
uright parameter to right shift
Returns
the generic result of t >> u

Definition at line 158 of file bitwise_operators.hpp.