I have a static map that is a private data member. How do I initialize it in the implementation file so that it’s initial containers are empty? It is not const. It is important that nothing is in this container at start.
I have a static map that is a private data member. How do I
Share
Header:
Implementation file:
That will insert a constructor call for your map into your program initialization code (and a destructor into the cleanup). Be careful though – the order of static constructors like this between different translation units is undefined.