Boost logo

Boost :

From: Ryan Gallagher (ryan.gallagher_at_[hidden])
Date: 2005-06-18 16:55:39

Brian Braatz <brianb <at>> writes:

> CLOSER (see below)
> > On Behalf Of Ryan
> > [snip]
> > Try:
> >
> > typedef mpl::copy
> > <
> > mpl::begin<myset>
> > , mpl::back_inserter<vec>
> > >::type result_vec;
> >
> > HTH
> >
> > -Ryan
> >
> [Brian Braatz Writes:]
> THANK YOU RYAN- I am compiling now (one step closer)
> But I am still not getting the expected (??) behavior
> here is the current code
> ...

Sorry about the leading you down the wrong path Brian. I was really thinking

typedef mpl::copy
      mpl::iterator_range<mpl::begin<myset>::type, mpl::end<myset>::type >
      , mpl::back_inserter< vec >
>::type result_vec;

which would only be a work around but IMO is more similar to the runtime
equivalent. I am a little suprised the mpl::begin<> compiled, but I need to
review Dave's and Alesky's MPL book again and will hopefully come to understand.

I was actually on the newsgroup yesterday to see the answer to your great
remove_duplicate_types question. I had just written the equivalent
runtime function using std::vector, std::sort, and std::unique and was wondering
about how to handle std::sort in the compile_time world. I stopped on this
thread because I saw that it could likely lead to the answer.

Thanks for the great question; I'll try to test a little better before answering
any in the future. Cheers,


Boost list run by bdawes at, gregod at, cpdaniel at, john at