help-gplusplus
[Top][All Lists]
Advanced

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

Re: template<> keyword unexpecting hide virtual members


From: Paul Pluzhnikov
Subject: Re: template<> keyword unexpecting hide virtual members
Date: Tue, 26 Dec 2006 06:41:05 -0800
User-agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Jumbo Shrimp, linux)

"Grizlyk" <grizlyk1@yandex.ru> writes:

> Is it bug or no?

Yes, in your code. 
Here is an error message from HP aCC, which explains it:

$ aCC -c junk.cpp
Error (future) 641: "junk.cpp", line 15 # Undeclared variable 'is_ok'. A 
variable with the same name exists in a template base class, but is not visible 
according to the Standard lookup rules (See [temp.dep], 14.6.2(3) in the C++ 
Standard). You can make
    it visible by writing 'this->is_ok'.
         return ( ptr && is_ok() )? 1: 0;
                         ^^^^^           
Fix:

   return ( ptr && this->is_ok() )? 1: 0;

> Must i post the bug to?

Don't bother: you'll be told the same thing.

Cheers,
-- 
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.


reply via email to

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