I have a templated class

template<class U, class V, class W>

class S

{

//... implementations

};

 

and some stock type implementations for type U, V and W:

 

typedef boost::mpl::vector<U0, U1> u_types;

typedef boost::mpl::vector<V0, V1, V2, V3, V4> u_types;

typedef boost::mpl::vector<W0, W1, W2, W3, W4> w_types;

 

I want to test class S with all possible combinations of the template arguments,

typedef boost::mpl::vector<

    S<U0,V0,W0>,

    S<U0,V0,W1>,

    // ...

    S<U1,V4,W4>,

    > s_types;

 

like this:

boost::mpl::for_each<s_types>(test_func).

 

The only problem is there are 2*5*5 =  50 combinations that I do not wish to type in one by one.

 

Is there a way to generate all the combinations with boost::mpl or Boost.Preprocessor?

 

thanks.