10 May
2007
10 May
'07
8:49 a.m.
Ares Lagae ha escrito:
Jeffrey Holle wrote:
Boost::variant if you want your variable to hold just one of the types, and hopefully you know what type is holds. You have to use a variant visitor to access it if you don't. Attempts to use get<int> when the type isn't castable to it will throw an exception.
Union-like containers are not suited, because I want a variable for _each_ of the types. See my other post about boost::fusion::map.
I guess fusion can be used to implement what you want, but MPL probably also suffices. Please see the attached file, is this kind of what you're after? Joaquín M López Muñoz Telefónica, Investigación y Desarrollo