Is it allowed to initialize a static class member in the constructor in C++? Im aware of this thing: (ex. variable class::name=0), but this does not work with a vector.
Gandalf the White
Static variable initialization
It is, but you will re-initialize it each time you create a new instance unless you specifically code your way around it (E.g. create a static boolean "g_bInitialized", which you set to true once the static member(s) is/are initialized).
/Niels
/Niels
<b>/NJ</b>
I am currently using static STL vectors in my engine, and have no problem initializing it. If I knew a way to use the greater-than and less-than symbols on this message board then I''d show you how I do it.
However, if you''re not using STL (or templates) for your vector implementation than I guess this wouldn''t help you too much
JoeG
However, if you''re not using STL (or templates) for your vector implementation than I guess this wouldn''t help you too much
JoeG
joeG
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement