H
Hubert Fritz
Hello,
I fear I want to have something which is not possible in C++.
How is it possible to define a base class so that the derived
class is forced to contain a static member variable, which can
be used by static member functions of the base class?
Something like
virtual static XClass* pXClass;
/* pXClass shall be pure virtual, so not static in base class, but
static in derived class */
The static class related part of the derivation could so provide
manager functionality for the object instances of the class.
The only solution I currently see is to have a base class
containing
XClass* pXClass; /* non static */
and related member functions.
Derive a singleton class from this, so I would have some "static"
effect. And have a separate class XClass chained by the derived class.
Best regards,
Hubert
I fear I want to have something which is not possible in C++.
How is it possible to define a base class so that the derived
class is forced to contain a static member variable, which can
be used by static member functions of the base class?
Something like
virtual static XClass* pXClass;
/* pXClass shall be pure virtual, so not static in base class, but
static in derived class */
The static class related part of the derivation could so provide
manager functionality for the object instances of the class.
The only solution I currently see is to have a base class
containing
XClass* pXClass; /* non static */
and related member functions.
Derive a singleton class from this, so I would have some "static"
effect. And have a separate class XClass chained by the derived class.
Best regards,
Hubert