prog.cpp: In function ‘int main()’:
prog.cpp:31:25: error: no matching function for call to ‘f(std::__cxx11::list<int>::iterator, std::__cxx11::list<int>::iterator)’
f(x.begin(), x.end());
^
prog.cpp:8:6: note: candidate: template<class Iterator, class U, class> typename std::enable_if<(! std::is_same<Iterator, U>::value), void>::type f(Iterator, U)
auto f(Iterator beg, U end)
^
prog.cpp:8:6: note: template argument deduction/substitution failed:
prog.cpp: In substitution of ‘template<class Iterator, class U, class> typename std::enable_if<(! std::is_same<Iterator, U>::value), void>::type f(Iterator, U) [with Iterator = std::_List_iterator<int>; U = std::_List_iterator<int>; <template-parameter-1-3> = void]’:
prog.cpp:31:25: required from here
prog.cpp:8:6: error: no type named ‘type’ in ‘struct std::enable_if<false, void>’
prog.cpp:35:25: error: no matching function for call to ‘f(std::vector<int>::iterator, std::vector<int>::iterator)’
f(v.begin(), v.end());
^
prog.cpp:8:6: note: candidate: template<class Iterator, class U, class> typename std::enable_if<(! std::is_same<Iterator, U>::value), void>::type f(Iterator, U)
auto f(Iterator beg, U end)
^
prog.cpp:8:6: note: template argument deduction/substitution failed:
prog.cpp: In substitution of ‘template<class Iterator, class U, class> typename std::enable_if<(! std::is_same<Iterator, U>::value), void>::type f(Iterator, U) [with Iterator = __gnu_cxx::__normal_iterator<int*, std::vector<int> >; U = __gnu_cxx::__normal_iterator<int*, std::vector<int> >; <template-parameter-1-3> = void]’:
prog.cpp:35:25: required from here
prog.cpp:8:6: error: no type named ‘type’ in ‘struct std::enable_if<false, void>’