template<typename R, typename... A>
class jau::InvocationFunc< R, A >
One goal to produce the member-function type instance is to be class type agnostic for storing in the toolkit.
This is essential to utilize a function-callback API, where only the provider of an instance knows about its class type.
Further we can't utilize std::function and std::bind, as std::function doesn't provide details about the member-function-call identity and hence lacks of the equality operator and std::bind doesn't even specify a return type.
A capturing lambda in C++-11, does produce decoration code accessing the captured elements, i.e. an anonymous helper class. Due to this fact, the return type is an undefined lambda specific and hence we can't use it to feed the function invocation into ClassFunction<> using a well specified type.
template<typename R, typename C, typename... A>
inline ClassFunction<R, A...>
bindClassFunction(C *base, R(C::*mfunc)(A...)) {
return ClassFunction<R, A...>(
(void*)base,
(void*)(*((void**)&mfunc)),
[&](A... args)->R{ (base->*mfunc)(args...); });
^
| Capturing lambda function-pointer are undefined!
}
Hence we need to manually produce the on-the-fly invocation data type to capture details on the caller's class type for the member-function-call, which are then being passed to the ClassFunction<> anonymously while still being able to perform certain operations like equality operation for identity.
Definition at line 78 of file function_def.hpp.