prog.cpp: In function ‘int main()’:
prog.cpp:16:8: error: no matching function for call to ‘f(const int&)’
f(y); // errror. no matching function
^
prog.cpp:16:8: note: candidate is:
prog.cpp:5:57: note: template<class T> typename std::enable_if<(! std::is_const< <template-parameter-1-1> >::value)>::type f(T&)
typename std::enable_if<!std::is_const<T>::value>::type f(T& arg)
^
prog.cpp:5:57: note: template argument deduction/substitution failed:
prog.cpp: In substitution of ‘template<class T> typename std::enable_if<(! std::is_const< <template-parameter-1-1> >::value)>::type f(T&) [with T = const int]’:
prog.cpp:16:8: required from here
prog.cpp:5:57: error: no type named ‘type’ in ‘struct std::enable_if<false, void>’