I need to repeatedly make calls to a template function with different classes defined elsewhere in the code, like so:
MyTemplateFunction<ClassOne>( &AnotherTemplateFunction<ClassOne> );
MyTemplateFunction<ClassTwo>( &AnotherTemplateFunction<ClassTwo> );
MyTemplateFunction<ClassThree>( &AnotherTemplateFunction<ClassThree> );
MyTemplateFunction<ClassFour>( &AnotherTemplateFunction<ClassFour> );
Is there a way to create an array of the specializations for the classes ClassOne, ClassTwo etc. so I can simply iterate over the array for better maintainability.
edit: I am specifically using the register_exception_translator function in Boost.Python. So I don't really have a choice. Its a third party function I have to call for all of my classes, which are over 50 in number in my project. Repeating the calls like this has been a messy experience when adding or modifying classes.