exptl
General C++20 library that complements the C++ Standard Library
|
Wraps around a callable object to provide function composition. More...
Public Member Functions | |
composable (Fn fn) | |
Creates a composable<Fn> wrapping the callable fn. More... | |
template<typename Fn2 > | |
auto | operator+ (Fn2 rhs) const |
Returns the composition of this composable and rhs. More... | |
template<typename... Args> | |
decltype(auto) | operator() (Args &&...args) |
Calls the wrapped function the provided arguments. More... | |
template<typename... Args> | |
decltype(auto) | operator() (Args &&...args) const |
Calls the wrapped function with the provided arguments. More... | |
Wraps around a callable object to provide function composition.
Fn | The callable object type. |
|
inline |
|
inline |
Calls the wrapped function the provided arguments.
Args | Type of the arguments to pass to the wrapped function. |
args | The arguments to pass to the wrapped function. |
|
inline |
Calls the wrapped function with the provided arguments.
Only allowed when the wrapped callable is equality preserving.
Args | Type of the arguments to pass to the wrapped function. |
args | The arguments to pass to the wrapped function. |
|
inline |
Returns the composition of this composable and rhs.
Given that fn
is the currently wrapped callable, returns a composable that wraps around a callable which invokes rhs(fn(args))
when called with the arguments args
.
Fn2 | Type of the callable object to compose with. |
rhs | The callable object to compose with. |