Boost logo

Boost Users :

From: Arkadiy Vertleyb (vertleyb_at_[hidden])
Date: 2004-07-20 14:49:36

"Delfin Rojas" <drojas_at_[hidden]> wrote

> What I'm trying to do is make a variant that is a superset of another
> variant. For that, I make an initial mpl sequence with the types of the
> first variant and create it. Then I make a second list with the extra
> of the second variant. I would then like to create the second variant
> passing the joint list of the first types sequence and second types
> sequence. That is why I wanted to use joint_view. Then I thought I would
> just push_back each of the second variant types to the first types
> but that failed too. Finally I am doing an insert at the end (essentially
> push_back but not quite).

If you just need to concatenate two sequences, you can use fold_backward and
push_front, something like:

template<class V1, class V2>
struct concatenate : mpl::fold_backward<
    mpl::push_front<_,_> // please verify this -- not sure about the
order -- may be <_2, _1>


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at