I am confused about the second parameter of std::enable_if. In using of a return type of int, we can make it using:
template
typename std::en
what's the difference of too functions below:
One is a template that can be called for any CopyConstructible type, the enable_if
only constrains it when the default template argument is used:
#include
template::value>::type >
T too(T t) { std::cout << "here" << std::endl; return t; }
int too(int t) { std::cout << "there" << std::endl; return t; }
int main()
{
too(1.0);
}