dependent names in templates

Gabriel Dos Reis gdr@integrable-solutions.net
Tue Dec 20 16:31:00 GMT 2005


Dima Sorkin <dima.sorkin@gmail.com> writes:

| Hi.
|   Consider the following case :
| template<typename T> struct Base{
|      void f() const {}
|      int X;
| };
| 
| template<typename T> struct Derived : public Base<T> {
|      void g() {
|          X = X+X;
|          f();   // LINE*
|      }
| };
| 
| gcc does not require to write in "line*" : "this->f()", "this->X"
| But there are compilers that do require, they cannot
| resolve the symbol "f()" otherwise.

Which version of GCC?  See changes for GCC-3.4.x

-- Gaby



More information about the Gcc-help mailing list