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: Grizlyk
Subject: Re: template<> keyword unexpecting hide virtual members
Date: 27 Dec 2006 20:59:40 -0800
User-agent: G2/1.0

Paul Pluzhnikov wrote:

> Do you mean you don't have the C++ Standard, or that your copy
> doesn't have section 14.6.2(3)?
I have no C++ Standard.

>   In the definition of a class template or in the definition of a
>   member of such a template that appears outside of the template
>   definition, if a base class of this template depends on a
>   template-parameter, the base class scope is not examined during
>   name lookup until the class template is instantiated.
>
> I don't know why this section was written that particular way,
> but there probably was a good reason for this, since this is
> somewhat unexpected. The reason possibly has to do with the fact
> that template specializations can almost completely change class
> interface.

I do not realize the cause of this. It seems to me the all names from
class declaration
must do not resolving till instance and of course external names must
not have more
force than native interface from public base class.

> Language experts over in comp.lang.c++ may have a ready explanation.
Yes, It is not g++ trouble.

The case was in FAQ example
(http://www.parashift.com/c++-faq-lite/templates.html#faq-35.14), but
it is really hard sometimes to get from anybody answer "why", not only
"what". (But the concrete question does not metter.)

The best way to change name is not "class::" or "this->" but "using
base<T>::method" befor first usage of name. it is so easy to forget
excplicit repeating methods of base class in derived :)



reply via email to

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