Boost MPL push_back all elements in one vector into another

85 views Asked by At

Just starting to look at boost MPL, say I have 2 vectors that I want to combine, is it possible with the boost MPL or do I need to write the code myself?

Say I have:

typedef vector<Class0, Class1, Class2, Class3> vec1;
typedef vector<Class4, Class5, Class6, Class7> vec2;

I did try push_back but I do not get the expected result:

typedef push_back<vec1, vec2>::type combinedVec;

What I end up with doing the above is a vector as follow:

vector<Class0, Class1, Class2, Class3, vector<Class4, Class5, Class6, Class7>>

What I want instead is:

vector<Class0, Class1, Class2, Class3, Class4, Class5, Class6, Class7>

Any help will be appreciated

0

There are 0 answers