I am unable to pass the DerivedObject class (part of the DerivedClass class obtained from the BaseClass template BaseClass ) derived from BaseObject (part of the BaseClass class BaseClass ) as a template argument to the BaseClass template BaseClass .
Thus, both the Base and Derived classes have access to the pool of objects, which may contain derived objects. This sounds a bit confusing, here is an example:
template <class TDerivedClass, class TDerivedObject> class BaseClass { protected: class BaseObject {
The above implementation of the base class.
error C2065: 'DerivedObject' undeclared identifier
The above error is the cause of the first line of the class definition below:
class DerivedClass : public BaseClass<DerivedClass, DerivedClass::DerivedObject> { protected: class DerivedObject : public BaseObject {
Is there any way to do this? If not, is there a better solution that will give me the same / similar functionality?
source share