I want to make a template function that takes a function and a vector and uses the function to map that vector to another vector that will be returned by the function templa
Here's my approach:
template struct ignore_value {typedef T type;};
template
T& declval();
template
typename ignore_value()(declval())),
std::vector >::type map_vec(F fnc, const std::vector& source);
template
typename ignore_value()
(declval(), declval >())),
std::vector >::type map_vec(F fnc, const std::vector& source);
It works with the same Demo that 0x499602D2 used, with both GCC and Clang in C++98 mode.