You will lose track of which template the specialization came from:
template<int A, int B> class X { void f(); }; template<int A> class X<A, 2> { void f(); }; int main() { X<1, 2>().f(); X<2, 1>().f(); }
GCC Outputs
m.cpp: In function 'int main()': m.cpp:6:12: error: 'void X<A, 2>::f() [with int A = 1]' is private m.cpp:10:19: error: within this context m.cpp:2:12: error: 'void X<A, B>::f() [with int A = 2, int B = 1]' is private m.cpp:11:19: error: within this context
If he simply said X<1, 2> and X<2, 1> , you will lose the important information contained in this diagnostic.
source share