edouarda / brigand

Instant compile time C++ 11 metaprogramming library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Creating a list without duplicates from other list.

CvRXX opened this issue · comments

Hello,

I'm wondering how I could do the following with brigand:

We have a list A which contains types which have subtypes:

using A = brigand::list<T1<ST1>,T2<ST1>,T3<ST2>,T4<S2>,T5<ST3>>
for example T1 looks like this:

template<SubType>
struct T1{
  using ST = SubType;
}

I would like to make from this list a list of subtypes without duplicates. So it would look like this:

brigand::list<ST1, ST2, ST3>

How do I achieve such a thing with brigand. Thanks in advantage!

BTW: This is an epic library, keep up the good work!

Would creating a set solve your problem?

But how do I get the sub types from the other list in?

You write a functor with a copy algorithm?

oke, will try that