Where are static data members stored? Is there some kind of static members table (as in “virtual methods table”)?
I’ve performed an experiment – seems like static members don’t affect sizeof() at all. Does it mean all references to static members are converted to a fixed address?
Where are static data members stored? Is there some kind of static members table
Share
The C++ standard doesn’t enforce a particular implementation. But typically static class members will be implemented in a similar fashion to “free” statics.
However, your observation that
sizeofshouldn’t be affected by static members is correct.