Hi,
I have been using boost.mpl for the first time recently and have solved a
number of tasks with boost.mpl now but have a problem with a bit of code I
thought should be working.
What is wrong with this bit of code using boost.mpl?
typedef vector, int_<3>, int_<2> > v1;
// I want to use max_element on a vector I am in the process of
constructing using a fold
typedef typename fold >, push_back<_1,
deref::type >::type> >::type v2;
// This code below compiles and runs fine to illustrate that max_element on
a vector works, but is not what I am after.
// I thought _1 in the max_element above would be a vector just as v1 below
is, but the one below works and the one above does not.
// typedef typename fold >, push_back<_1,
deref::type> >::type v2;
I know this code is only going to create v2 like [0, 0, 0, 0] in this case
but this is a smaller part of a larger expression that is failing and I cut
it down to the minimum to show the problem at hand.
In case it is useful I am using gcc 4.5.3 and boost 1.50