Re: strange compiler behavior (gcc 4.0)
Re: strange compiler behavior (gcc 4.0)
- Subject: Re: strange compiler behavior (gcc 4.0)
- From: "Clark Cox" <email@hidden>
- Date: Thu, 12 Oct 2006 20:32:43 -0400
The language standard dictates this behavior. In this case, GCC is
correct, and VC is not. The solution it to prefix the members with the
scope (as you have shown) or to prefix them with "this->".
On 10/12/06, Daimen Duncan <email@hidden> wrote:
Using Xcode 2.4 and gcc 4.0:
I have a base class, like so:
template <class T> class Aryptr
{
…
protected:
value_type *elems;
int numElems;
…
}
Then I have a derived class, like so:
template <class TDec> class TAryA : public Aryptr <typename
TDesc::ValueType>
{
…
public:
void Dealloc() {elems = 0; numElems = maxElems = 0;}
…
}
This is pretty straight forward stuff, but the compiler complains
that the members (elems, numElems) are "not declared in this scope".
If I prefix with Base:: it stops complaing, but I'm not about to
rewrite all my code for the specific compiler, it compiles fine in VS
(which is admittedly less strict).
Am I being stupid or is there a "don't be stupid" compiler setting?
Thanks,
~Duncan
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
--
Clark S. Cox III
email@hidden
My CV/Resume:
http://homepage.mac.com/clarkcox3/files/Resume.pdf
http://homepage.mac.com/clarkcox3/files/Resume.html
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden