struct A{ static const int value = 2;};const int A::value; template <typename T>struct B{ static const int value = sizeof(T);};template <typename T>const int B<T>::value; #include <iostream> int main(){ std::cout << A::A::A::A::A::A::A::value << '\n'; std::cout << ( B<char>::B::template B<int>::B::value ) << '\n';}
Standard input is empty
prog.cpp: In function ‘int main()’: prog.cpp:20:32: error: ‘template’ (as a disambiguator) is only allowed within templates prog.cpp:20:43: error: expected primary-expression before ‘int’ prog.cpp:20:43: error: expected ‘)’ before ‘int’
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!