F
flopbucket
Hi,
If I have the following:
template<class T>
class A
{
public:
int a;
};
template<class T>
class B : public A<T>
{
public:
void test()
{
A<T>::a=5;
}
};
I see I need to do A<T>::a=5 in B<T>::test(). With non-template
inheritance, this isn't needed - can just to a=5.
I guess there is a good reason for this, unless I am missing something
silly, but could anyone explain a bit why, or point to further
reference?
Thanks
If I have the following:
template<class T>
class A
{
public:
int a;
};
template<class T>
class B : public A<T>
{
public:
void test()
{
A<T>::a=5;
}
};
I see I need to do A<T>::a=5 in B<T>::test(). With non-template
inheritance, this isn't needed - can just to a=5.
I guess there is a good reason for this, unless I am missing something
silly, but could anyone explain a bit why, or point to further
reference?
Thanks