In this answer I create a type trait:
template<typename T>
using to_string_t = decltype(to_string(declval<T>()));
This works just fine but I originally set out to use result_of
and now it's irking me that I can't figure out how to do it.
I'm trying to replace the line above with something like this:
template<typename T>
using to_string_t = result_of<to_string(T)>;
But I get a compiler error along the lines of:
error C2275: 'T': illegal use of this type as an expression
note: see declaration of 'T'
error C2974: 'std::result_of': invalid template argument for '_Fty', type expected
I've tried several other inputs to result_of
without success, can anyone help me understand what arguments result_of
is expecting here?