From Variadic Arguments to its Inner Types as Variadic Arguments

37 Views Asked by At

I am checking if variadic arguments are unique using the below:

template<class T, class... Ts>
constexpr bool is_unique_v = (!std::is_same_v<T, Ts>&& ...) && is_unique_v<Ts...>;

template<class T>
constexpr bool is_unique_v<T> = true;

I am trying to do the below (commented):

template<class B, class C>
class A
{
    using BT = B;
    using CT = C;
};

template<class... BorCs>
    requires is_unique_v<BorCs...>
class D
{
    using UT = std::tuple<BorCs...>;
};

//How can do the below?
template<class... As>
class E
{
    //N = size of As
    //using DT = D<Unique(As[0]::BT, As[0]::CT, ..., As[N]::BT, As[N]::CT)>; //The order here does not matter
};

I am not sure how I can do the above. Any ideas are welcomed!!

0

There are 0 best solutions below