J
John Femiani
Hi all,
I have come across a problem using g++. The example below illustrates
the issue:
--------------------------------------------------------
#include <iostream>
template<class T>
struct A {
int member;
};;
template<class T>
struct B: A<T> {
void somefunc() {
std::cout << member << std::endl;
}
};
------------------------------------------
The code above compiles with vc8 but not g++ 3.4.2.
g++ complains that there is no symbol named 'member'..
If A and B are not a template classes then there is no problem.
Is there a bug in g++? or vc8? What is the proper behavior here?
Note that if I use this->member it compiles with g++ for some reason.
Thanx,
-- John
I have come across a problem using g++. The example below illustrates
the issue:
--------------------------------------------------------
#include <iostream>
template<class T>
struct A {
int member;
};;
template<class T>
struct B: A<T> {
void somefunc() {
std::cout << member << std::endl;
}
};
------------------------------------------
The code above compiles with vc8 but not g++ 3.4.2.
g++ complains that there is no symbol named 'member'..
If A and B are not a template classes then there is no problem.
Is there a bug in g++? or vc8? What is the proper behavior here?
Note that if I use this->member it compiles with g++ for some reason.
Thanx,
-- John