template <typename T>class base{public: typedef T booboo;}; template <typename T>class derived : public base<T>{public: //typedef typename base<T>::booboo booboo; <-- fixes the problem booboo boo() { booboo bb = T(1); return bb; }}; int main(){ derived<int> d; d.boo(); return 0;}
Standard input is empty
prog.cpp:13:4: error: ‘booboo’ does not name a type prog.cpp:13:4: note: (perhaps ‘typename base<T>::booboo’ was intended) prog.cpp: In function ‘int main()’: prog.cpp:23:6: error: ‘class derived<int>’ has no member named ‘boo’
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!