
Daniel Frey <daniel.frey@aixigo.de> wrote:
template <typename U> void f (const B<U>&) { U<double> v; v.g(); }
There's an error: C:\DATA\USERS\bronislaw\My Documents\msys\T248.cpp(15) : error C2143: syntax error : missing ';' before '<' C:\DATA\USERS\bronislaw\My Documents\msys\T248.cpp(22) : see reference to function template instantiation 'void f<V>(const B<T> &)' being compiled with [ T=V ] C:\DATA\USERS\bronislaw\My Documents\msys\T248.cpp(15) : error C2143: syntax error : missing ';' before '<' C:\DATA\USERS\bronislaw\My Documents\msys\T248.cpp(16) : error C2065: 'v' : undeclared identifier C:\DATA\USERS\bronislaw\My Documents\msys\T248.cpp(16) : error C2228: left of '.g' must have class/struct/union type type is ''unknown-type'' I think that instead should be: template <template <typename> class U> void f (const B<U>&) { U<double> v; v.g(); } after this small change it compiles fine, and result is: double Regards B.