cxxomfort
rel.20211024
Simple backports for C++ - https://ryan.gulix.cl/fossil.cgi/cxxomfort/
|
Supplements to <functional>.
This component offers a number of alternatives and supplements to features found in <functional>
such as function objects to complete various tasks, a function-like reference wrapper, and function objects that complement the plus
family.
#noop
- an object that does nothing with its arguments.ptr_fun()
for nullary functions.preincrement
, predecrement
.plus_it
, minus_it
, multiplies_it
, divides_it
, modulus_it
.equivalent_to
("not less or greater").is_std_function
.constant_function
.true_fn()
, false_fn()
and constant_fn()
that create specific constants.#functiontype
- meta information on function signatures.#function_caller
- zero-cost function object calling a named C function.#function_ref
- non-owning reference to a function-like callable.overload()
metafunction.Given a Standard C++ operator wrapper like std::plus
, which wraps operator+()
, cxxomfort also provides an analogue plus_it
which wraps operator+=()
. That is, they operate in the following way:
The cxxomfort supplemental functor equivalent_to
tests for potential "equivalence" between two objects - that is, none is less than the other.