[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: problem with templates under gcc 3.4.2
From: |
Maurizio Loreti |
Subject: |
Re: problem with templates under gcc 3.4.2 |
Date: |
24 May 2005 12:16:42 +0200 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 |
"Salem" <derisavi@gmail.com> writes:
> Hi everybody,
> I appreciate your advice and help on the following compilation
> problem I have with gcc 3.4.2-6 which comes with Fedora Core 3. Using
> gcc 3.2.3 or 3.3, the code compiles with no problem. For the following
> piece of code:
>
> #include <stdlib.h>
>
> template <class T>
> class B {
> public:
> B() {}
> protected:
> int* state;
> };
>
> template <class T>
> class C : public B<T> {
> public:
> C() {
> state = NULL;
Make that B<T>::state = NULL; refer to the "C++ templates FAQ" for
explanation, at
http://www.decadentplace.org.uk/womble/c++/template-faq.html#base-lookup .
--
Maurizio Loreti http://www.pd.infn.it/~loreti/mlo.html
Dept. of Physics, Univ. of Padova, Italy ROT13: ybergv@cq.vasa.vg