![]() |
Lumiera 0.pre.04~rc.1
»edit your freedom«
|
#include "lib/meta/function-closure.hpp"
Partial function application Takes a function and a value tuple, using the latter to close function arguments either from the front (left) or aligned to the end of the function argument list.
Result is a "reduced" function, expecting only the remaining "un-closed" arguments at invocation.
| SIG | signature of the function to be closed, either as function reference type or std::function object |
| VAL | type sequence describing the tuple of values used for closing arguments |
std::bind (which can be confusing) Definition at line 291 of file function-closure.hpp.
Public Types | |
| using | LeftReducedFunc = function< typename BuildFunType< Ret, ArgsL >::Sig > |
| using | RightReducedFunc = function< typename BuildFunType< Ret, ArgsR >::Sig > |
Static Public Member Functions | |
| static LeftReducedFunc | bindFront (SIG const &f, Tuple< ValTypes > arg) |
do a partial function application, closing the first argumentsf(a,b,c)->res + (a,b) yields f(c)->res | |
| static RightReducedFunc | bindBack (SIG const &f, Tuple< ValTypes > arg) |
do a partial function application, closing the last argumentsf(a,b,c)->res + (b,c) yields f(a)->res | |
Definition at line 293 of file function-closure.hpp.
Definition at line 294 of file function-closure.hpp.
Definition at line 295 of file function-closure.hpp.
Definition at line 296 of file function-closure.hpp.
Definition at line 297 of file function-closure.hpp.
Definition at line 306 of file function-closure.hpp.
Definition at line 307 of file function-closure.hpp.
Definition at line 309 of file function-closure.hpp.
Definition at line 310 of file function-closure.hpp.
|
private |
Definition at line 314 of file function-closure.hpp.
|
private |
Definition at line 315 of file function-closure.hpp.
|
private |
Definition at line 319 of file function-closure.hpp.
|
private |
Definition at line 320 of file function-closure.hpp.
|
private |
Definition at line 322 of file function-closure.hpp.
|
private |
Definition at line 323 of file function-closure.hpp.
|
private |
Definition at line 330 of file function-closure.hpp.
|
private |
Definition at line 333 of file function-closure.hpp.
|
private |
Definition at line 335 of file function-closure.hpp.
|
private |
Definition at line 336 of file function-closure.hpp.
|
private |
Tuple to hold all argument values, starting from left.
Any remaining positions behind the substitute values are occupied by binding placeholders
Definition at line 341 of file function-closure.hpp.
|
private |
Tuple to hold all argument values, aligned to the end of the function argument list.
Any remaining positions before the substitute values are occupied by binding placeholders
Definition at line 345 of file function-closure.hpp.
| using LeftReducedFunc = function<typename BuildFunType<Ret,ArgsL>::Sig> |
Definition at line 349 of file function-closure.hpp.
| using RightReducedFunc = function<typename BuildFunType<Ret,ArgsR>::Sig> |
Definition at line 350 of file function-closure.hpp.
| Enumerator | |
|---|---|
| ARG_CNT | |
| VAL_CNT | |
| ROFFSET | |
Definition at line 299 of file function-closure.hpp.
do a partial function application, closing the first arguments
f(a,b,c)->res + (a,b) yields f(c)->res
| f | function, function pointer or functor |
| arg | value tuple, used to close function arguments starting from left |
2/2025 However, the LeftReplacedArgs could then possibly moved into the bind function, as could the functor, once we replace the Apply-template by STDLIB features.
5/2025 seems indeed we could perfect-forward everything into the binder object.
Definition at line 368 of file function-closure.hpp.
References lib::meta::func::bindArgTuple().
Referenced by FunctionComposition_test::check_partialApplication().
Here is the call graph for this function:
Here is the caller graph for this function:do a partial function application, closing the last arguments
f(a,b,c)->res + (b,c) yields f(a)->res
| f | function, function pointer or functor |
| arg | value tuple, used to close function arguments, aligned to the right end. |
Definition at line 383 of file function-closure.hpp.
References lib::meta::func::bindArgTuple().
Referenced by FunctionComposition_test::check_partialApplication().
Here is the call graph for this function:
Here is the caller graph for this function:
Collaboration diagram for PApply< SIG, VAL >: