|
Boost Users : |
Subject: Re: [Boost-users] [MPL] unique not working?
From: Michael Marcin (mike.marcin_at_[hidden])
Date: 2013-10-14 21:56:43
On 10/14/2013 4:28 PM, Rodrigo Madera wrote:
> Then again, taking a deeper look on your snippet, you are sorting all
> kinds of types.
>
> I remember seeing something similar in a thread here and found it at [1].
>
> It works by creating an ascending sequence of types, and sorting them
> according to the distance (or rather the index) of the types. You may
> need to put some more types in there according to what you expect from
> your clients.
>
> Your other option is providing the less<> types needed for sort<> to
> know the ordering relation between types.
>
I ended up just creating a set from the types instead.
typedef typename fold< vector<Args...>
, set0<>
, insert<_1, _2>
>::type unique_args;
Thanks.
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