help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Wired things happen with g++-3.3.5


From: red floyd
Subject: Re: Wired things happen with g++-3.3.5
Date: Sat, 15 Oct 2005 06:34:11 GMT
User-agent: Mozilla Thunderbird 1.0.6 (Windows/20050716)

PengYu.UT@gmail.com wrote:
The following gives an error at line 20. However, if I change all
"doit1" to "doit". I will only get warnings. Is there any thing wrong
with gcc?

g++-3.3 -g -Wall -W -I/usr/local/include/clapack/  -c -o main.o main.cc
main.cc: In member function `void C::doit1(typename A<T>::iterator*)':
main.cc:20: error: parse error before `;' token
main.cc: In function `int main(int, char**)':
main.cc:25: warning: unused parameter `int argc'
main.cc:25: warning: unused parameter `char**argv'
make: *** [main.o] Error 1
/////////////////////

template <typename T>
class A {
  public:
    class iterator{
    };
};

class B {
  public:
    template <typename T>
    void doit(typename A<T>::iterator *it){
    }
};

class C {
  public:
    template <typename T>
    void doit1(typename A<T>::iterator *it){
      B b;
      b.doit<T>(it);//line 20
    }
};

int main(int argc, char *argv[])
{
  A<int>::iterator it1;
  C c;
  c.doit1<int>(&it1);
}


Comeau online seems to like it.  Cross posting to gnu.g++.help


reply via email to

[Prev in Thread] Current Thread [Next in Thread]