I use the following construct to create a mpl vector of types.
struct Struct1{
typedef int type;
};
struct Struct2{
typedef float type;
};
template<typename T> struct TypeReader{
typedef typename T::type type;
};
int main()
{
typedef bm::vector<Struct1,Struct2> MPLVector;
typedef bm::transform<MPLVector, TypeReader<bm::_1>>::type TypeList;
static_assert(bm::equal<TypeList, bm::vector<int,float> >::value, "Is not same");
}
So far this works as expected. Now what I would like to do is the following
struct Struct3{
typedef bm::vector<char,double> type;
};
typedef bm::vector<Struct1,Struct2,Struct3> MPLVector;
typedef bm::transform<MPLVector, TypeReader<bm::_1>>::type TypeList;
static_assert(bm::equal<TypeList, bm::vector<int,float,char,double> >::value, "Is not same");
This does not work. So how do I need to change my MetaFunction struct that it will work with both, just a typedef and a mpl::vector?
Or if this is not possible would it be possible to do this if I change all type typedefs to mpl vectors?