This works fine:
class A{
protected:
int i;
};
class B:public A{
public:
void f(){
i=5; //fine
}
};
However if I try to do the same with static polymorphism, it fails:
template <class Derived, typename T, int N>
class Vector{
protected:
std::vector<T> v;
Then:
template <typename T, int N>
class Vector234:public Vector<Vector234<T, N>,T,N>{
void test(){
T t=v[0]; // v is undeclared identifier
}
Why is this?