MEL
Microthread & Execution library
mel::mpl::ParamAdder< T, TRet, NewArg, VARIABLE_ARGS > Class Template Reference

create new functor with new param for operator() AFTER any other param usage: suppose we have a function with signature: int f( ) and we need this function to adapt to a function with one argument of, for example, float type. Then do: addParam<int,float,void>( f ); That create a function wich receives a float, so you call that function this way: addParam<int,float,void>( f )( 6.7f ); where first argument is return type, second is new type and else original arguments More...

#include <ParamAdderImpl.h>

Public Member Functions

 ParamAdder (T &&functor)
 
TRet operator() (VARIABLE_ARGS_IMPL, NewArg newarg)
 

Detailed Description

template<class T, class TRet, class NewArg, VARIABLE_ARGS>
class mel::mpl::ParamAdder< T, TRet, NewArg, VARIABLE_ARGS >

create new functor with new param for operator() AFTER any other param usage: suppose we have a function with signature: int f( ) and we need this function to adapt to a function with one argument of, for example, float type. Then do: addParam<int,float,void>( f ); That create a function wich receives a float, so you call that function this way: addParam<int,float,void>( f )( 6.7f ); where first argument is return type, second is new type and else original arguments

same is valid for functors with more params and other return values. Example: void f( int, float ) --> want to convert to void f( int, float, char ); addParam<void,char,int,float>( f )(5,6.7f,'a');

this is neccesary in a lot of cases, for example, when chaining functors with different arguments types


The documentation for this class was generated from the following file: