
Hello meta programmers,
I am looking for a way to extract a sub sequence of a given type list by identifying the begin/end of the sub sequence by the corresponding iterators
<code>
#include
, mpl::back_inserter< mpl::vector<> > ::type my_sub_types;
</code>
This code (and lots of slight variations) does not compile. Why ?
Any hint (conceptual,syntactical,etc.) is welcome !
regards,Martin.

"Martin Pasdzierny"
// here is my type list typedef mpl::vector
my_types; // from_pos and to_pos are start and end iterators of the subsequence typedef typename mpl::find
::type from_pos; typedef typename mpl::find ::type to_pos; // all elements (types) of my_types should be copied into the new seuqence my_sub_types if their iterator (index) is inside the given interval (from_pos,to_pos) typedef mpl::copy_if
::type, mpl::int_ > , mpl::less< mpl::find ::type, mpl::int_ > , mpl::back_inserter< mpl::vector<> > ::type my_sub_types;
</code>
This code (and lots of slight variations) does not compile. Why ?
Most likely because mpl::greater, etc., are defined to work with integral
constants, not with iterators.
I think you should just use iterator_range:
typedef mpl::iterator_range
participants (2)
-
Arkadiy Vertleyb
-
Martin Pasdzierny