This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
dependent names in templates
- From: Dima Sorkin <dima dot sorkin at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Tue, 20 Dec 2005 16:22:05 +0200
- Subject: dependent names in templates
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.
I have a portable c++ code, besides this case.
Is there some automatic way to find and correct
all occurencies of such a case in the code?
I always work with gcc, but I will
need to port the code to vendor provided
compiler soon (to sgi mipspro).
Thank you.
Dima.