Consider the following pseudo code :
template<class... T>
struct worker : unique<T...>::type...{};
struct x{};
struct y{};
struct z{};
Is it possible to write a template unique such that it generates a parameter pack consisting of only unique types among Ts, so that worker<x,y,x,z> will be directly derived from x, y, z respectively ,in that order, given Ts are non final classes?
AFAIK: No.
The problem is that
typeis the result of atypedefdirective, andtypedefcannot alias packs. It is actually a bother, and most often computations on packs require introducing a wrapper type (such astemplate <typename...> struct pack {};) just to be able to pass them around.