[MPL] Applying a boost::mpl::list to the template parameter of a type.

Hello,
I have a class that requires a boost::variant containing shared pointers to
various types as follows:
template

I have a class that requires a boost::variant containing shared pointers to various types as follows: template
class ToyPicker { typedef std::pair< ToySharedPtrVariant, ColorSharedPtrVariant > toyAndColorPair; typedef std::map< std::string, std::vector< toyAndColoPair > > stringToToyColorPairMap; // ... methods that use the defined types... } This class currently requires template parameters of the following form to compile: ToyPicker< boost::variant< boost::shared_ptr<ToyModel> >, boost::variant< boost::shared_ptr<BlueToy>, boost::shared_ptr<RedToy>, boost::shared_ptr<GreenToy> > > toyPicker; How do I use an mpl list so that I can allow the following much simpler definition for users, then convert it into the one above inside my class? ToyPicker< boost::mpl::list< ToyModel >, boost::mpl::list< BlueToy, RedToy, GreenToy > > toyPicker;
If you got you right, you map a Model to a list of Colors, right?
I'm not a TMP expert, but I'd propose something like this:
#include
participants (2)
-
Andrew Hundt
-
Igor R