I am learning C++ using the books listed here. Now, to further check that I've understood the concepts I'm also writing simple sample programs. One such program that compiles with msvc but does not compile with clang and gcc is given below. Demo.
template<typename P> struct C{
template<typename T>
struct E
{
template<typename U = P, typename V = T>
friend bool operator==(const typename C<U>::template E<V>&,
const typename C<U>::template E<V>&);
};
};
int main()
{
C<int>::E<double> d1, d2;
std::cout<<(d1==d2); //compiles with msvc but rejected in gcc and clang
}
So, my question is which compiler is right here(if any) according to the standard.