Do lambda function have a signature so that I can pass them around?
template<class Fn>
HRESULT foreach(Fn _fuction)
{
}
object->foreach(
[param1, param2] (int item)
{
}
);
object->foreach(
[param1, param2, param3] (int item)
{
}
);
I want to use a typedef function instead of templates, I think the type of the function will strict the formal parameters but will allow captured list to vary.
can I use typedef instead of templates to pass lambda functions around?
something like:
typedef void (*Fn)(int);
but allows lambda not function pointer.
I tried using std::fuction but seems not working.
function. - dlfstd::function? seems not working isn't a particularly useful description. - Praetorian