This question came to my mind, when I had something like
enum Folders {FA, FB, FC};
and wanted to create an array of containers for each folder:
ContainerClass*m_containers[3];
....
m_containers[FA] = ...; // etc.
(Using maps it's much more elegant to use: std::map<Folders, ContainerClass*> m_containers;
)
But to come back to my original question: What if I do not want to hard-code the array size, is there a way to figure out how many items are in Folders? (Without relying on e.g. FC
being the last item in the list which would allow something like ContainerClass*m_containers[FC+1]
if I'm not mistaken.)