I try to deduce the type of callable template parameter, unfortunately without success:
template<typename callable, typename T_out >
class A
{};
template<typename callable>
auto make_A( callable f )
{
return A<callable, typename std::result_of_t<callable> >{ f };
}
int main()
{
make_A( []( float f ){ return f;} );
}
The code above causes the following error:
error: implicit instantiation of undefined template 'std::__1::result_of<(lambda at /Users/arirasch/WWU/dev/xcode/tests/tests/main.cpp:31:11)>'
template <class _Tp> using result_of_t = typename result_of<_Tp>::type;
Does anyone know how to fix it?
Many thanks in advance.