Why does the following compile with clang
but not with g++ 4.9
#include <array>
template< typename T1, typename T2 , typename T3 = int>
struct A;
template<typename T, unsigned int N, typename T2, typename T3>
struct A< std::array<T,N>, T2, T3 > {
int a;
};
int main()
{
A< std::array<int,10>, double> a;
a.a +=3;
}
http://coliru.stacked-crooked.com/a/c7800f49ba5aac43
g++ does not find a suitable specialization and complains with "incomplete type". I am wondering since, the default argument typename T3 = int
should apply for the specialization (or does it only apply for full specialization?)