C++: nested class of a template class
Consider the following code: template < typename T > struct A { struct B { }; }; template < typename T > void f( typename A<T>::B ) { } int main() { A<int>::B x; f( x ); // fails for gcc-4.1.2 f<int>( x ); // passes return 0; } So here gcc-4.1.2 requires the template argument of f to be explicitly specified. Is this meet the standard? Does the newer versions of GCC have this issue fixed? How can I avoid explicitly specifying int while calling f ? Update: Here is a workaround. #include <boost/static_assert.hpp> #include <boost/type_traits/is_same.hpp> template < typename T > struct A { typedef