Boost logo

Boost Users :

Subject: Re: [Boost-users] [MPL] unique not working?
From: Rodrigo Madera (rodrigo.madera_at_[hidden])
Date: 2013-10-14 13:13:38


On Mon, Oct 14, 2013 at 12:56 AM, Gordon Woodhull <gordon_at_[hidden]>wrote:
>
> > On Oct 13, 2013, at 11:44 PM, Michael Marcin <mike.marcin_at_[hidden]>
> wrote:
> >
> > I pass a mpl::vector with duplicates to mpl::unique and the result still
> has duplicates.
> > What am I doing wrong?
>
> Just like std::unique, the duplicated elements must be consecutive for
> mpl::unique to find them.
> Otherwise the complexity wouldn't be linear.

Michael,

Use mpl::sort (
http://www.boost.org/doc/libs/1_54_0/libs/mpl/doc/refmanual/sort.html)
first on your sequence.

Rodrigo



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