I have a class with a member m_preferences
(a vector containing assocation between word and features).
In this class the m_preferences
is not static and thus any instance of the class has its specific m_preferences
.
class Base{
private:
Preferences m_preferences;
public:
...
}
I then created a derived class where m_preferences
become static because I wanted that each new instance of this class share the same data for preferences no matter what happens.
class Derived: public Base{
private:
static Preferences m_preferences;
public:
...
}
I got a linking error.
Is it possible to do what I want to do (transforming a non-static member into a static one through inheritance)?
If not what are the philosophy behind this impossibility? Was it planned?
Thank you,
Sincerely,
Ronan