I understand ( here is one source) that you can override the default template arguments if the two definitions do not conflict. So, I am trying to compile the following with g ++ 5.3.1:
template <class = int> class A;
template <class T = A<>> struct B {};
template <class T = int> class A {};
int main() { return 0; }
The compiler complains:
error: overriding default argument for class T
Where is my understanding wrong?
source
share