I wonder if we could do something like
a.pushType<int>
a.pushType<std::string>
a.pushType<char>
so than we could call
std::map<a.T1, a.T3> mymap;
std::map<a.T1, a.T2> mymap;
someClass<a.T1, a.T2, a.T3>
And I need it not at run time but at compile time (for providing it in my header only library.)
Is it possible with C++03 and Boost?
That’s a mechanism called TypeLists; as far as I know it was first proposed by Andrei Alexandrescu in Modern C++ Design. There’s an implementation of TypeLists in Alexandrescu’s library, Loki. I also think Boost.MPL has a similar construct: the vector.