I have a boost::mpl Sequence like this:
typedef boost::mpl::vector<
char, unsigned char, short, unsigned short, int, unsigned int, float, double
> TTypes;
I have a specific-purpose container class which I want to export from my dll:
template<typename T>
class Container { T* _elements; }
Now what I need in my header (MSVC compiler) is several lines like this:
template class __declspec(dllexport) Container<char>;
template class __declspec(dllexport) Container<short>;
and so on (and I need the same but with dllimport for the clients of this library to include).
Now my question is, is there a way to generate these lines from my mpl vector?
I suspect this isn't possible, so my fallback: is there a way to get the preprocessor to do this for me? So, are there any (boost) macros that will somehow loop over the elements in a Sequence (it's fine if I have to use some special syntax to define my Sequence) so that I can do something with the type names in preprocessor strings?