|
Boost Users : |
Subject: Re: [Boost-users] combining mpl sequences
From: Karsten Ahnert (karsten.ahnert_at_[hidden])
Date: 2010-09-05 16:35:16
> You're already most of the way there. If you can break it down into
> three similar steps, you can write a single step as a metafunction:
>
> template <class PrevResult, class MyType>
> struct step
> : mpl::insert_range<
> PrevResult ,
> mpl::end< PrevResult >::type ,
> containers< MyType >
> >
> {};
>
> Then you can fold that step across your types:
>
> typedef typename
> mpl::fold< my_types, mpl::vector<>, step<mpl::_,mpl::_> >::type
> all_containers;
>
> This produces a sequence with a different ordering than the one in
> your "hence" clause, but it's the same ordering as you'd get in your
> own all_containers above.
Thanks, this starts to become fun. I also found another way with copy
and inserters.
Cheers,
Karsten
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net