Say I have a class that contains a map with a pointer-type key:
class Base;
class App
{
private:
size_t n;
map<string, Base*> m;
};
What I want is that, when I refer to a map key for the first time, I need the "Base*" pointer already allocated for "n" elements. I can't do this allocation in the constructor, because the map key value will only be known at run-time. Not sure what is the best solution for this.
ndetermined? Is it a compile-time constant?