Template partial ordering - why does partial deduction succeed here
Consider the following simple (to the extent that template questions ever are) example: #include <iostream> template <typename T> struct identity; template <> struct identity<int> { using type = int; }; template<typename T> void bar(T, T ) { std::cout << "a\n"; } template<typename T> void bar(T, typename identity<T>::type) { std::cout << "b\n"; } int main () { bar(0, 0); } Both clang and gcc print "a" there. According to the rules in [temp.deduct.partial] and [temp.func.order], to determine partial ordering, we need to synthesize some unique types. So we have two attempts at deduction: +---+--