The alternative I thought of is to manually declare the numbers of extensions like : const int NB_EXTENSIONS = 10; which can be problematic is you forget to update it when modifying EXTENSIONS. That is exactly your second point.

There is another alternative using 'template mumbo-jumbo' to achieve this: http://stackoverflow.com/a/13375725