help-gplusplus
[Top][All Lists]
Advanced

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

Re: Unexpected error when using hierarchy of template classes


From: Simon Buchan
Subject: Re: Unexpected error when using hierarchy of template classes
Date: Tue, 27 Sep 2005 15:09:39 +1200
User-agent: Mozilla Thunderbird 1.0.6 (Windows/20050716)

JH Trauntvein wrote:
Paul Pluzhnikov wrote:

"JH Trauntvein" <j.trauntvein@comcast.net> writes:


test.cpp:13: error: object missing in reference to 'Value::storage'

This looks like a gcc bug (but you need a language lawyer to say
for sure). Workarounds:

   { out << this->Value::storage; }      or
   { out << this->storage; }



Thanks,

It turns out that I can invoke a member function of the base class
which I had already defined called get_storage().  I didn't think to
try using "this".

Regards,

Jon Trauntvein
This is very likely a bug in gcc's two-stage name lookup, as storage is _definitely_ not a dependant name. this->storage (preffered over this->Value::storage to enable propper name lookup) disables non-dependant name lookup for storage by making it dependant (this is a dependant name.)





reply via email to

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