Don't think this is a Curiously Tecurring Template (CRT) pattern
In this case the CRT would be
1 2
template<class T>
class ListLayers: public DepthLayers< ListLayers<T> >
Anway, when it comes to templates - the compiler is not under any obligation to recognize unqualified variable names from the base class when they are referenced in the derived class as you have done above.
But - Microsoft Visual C++ will allow it, but not GCC.
try this->test =5;
I meant that the way your original post was written MSVC would accept it but GCC won't - (GCC being tecnically correct to the c++ standard but MSVC being forgiving and understanding exactly what you were trying to do).