|
From: Greg C. <gch...@sb...> - 2011-09-16 22:15:18
|
On 2011-09-16 18:35Z, George Brink wrote:
>
> I am not sure why protected inheritance does not work the same way in
> templates as it works in normal classes.
C++2003 14.6.2/3 says "if a base class of the class template depends
on a template-parameter, the base class scope is not examined during
unqualified name lookup".
> As a quick solution, you can help the child template to find the
> variable in the parent:
> Type getValue() {
> return Number<Type>::value * Number<Type>::value;
> }
Or:
return this->value * this->value;
Or add this inside class Sqr<>:
using Number<Type>::value;
|