I've a class that has a member of type std::map
. This map
is created through calling a method of this class, makeMap()
. It reads a config file and fills the map
.
In my scenario, I create one instance of this class and construct the map
. Then recursively some problem is solved, involving many copies of the object. The map
however stays the same (some other members are change).
Should such a map
be static const
? Since it does not change after creation and creation could be done when the first instance is created, it makes no sense to copy the map
when the instance is being copied.
Is that a good use of static const
?