15 May
2013
15 May
'13
9:48 a.m.
On 15 May 2013 09:35, Oliver Kowalke wrote:
I could overload the ctor of X for function pointers:
template< typename Arg > X( void(*fn)( Y< Arg > &) ) {...}
but how to deal with the other two callable types? result_of and function_traits did not work for me.
In general there is no unique argument_type for callable objects, they could have overloaded function call operators. If http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3579.html makes it into the standard you could find out the argument type *for a given invocation* i.e. you can ask "what is the type of the first argument when called as f(x, y, z)", but not "what is the argument_type of F"