Skip to content

Add UniqueTypes_t helper template alias

Carsten Gräser requested to merge feature/add-uniquetypes-helper into master

For a given template<class...> Target and list of types T... the alias UniqueTypes_t<Target, T...> refers the instatiated template Target<S...>, where S... is generated from T... by removing duplicate types.

This is useful for std::variant, because duplicate types are not fully supported by some implementations. If your type list is generated by whatever mechanism where you don't have control over uniqueness, then UniqueTypes_t<std::variant, T...> is what std::variant<T...> should have been.

Merge request reports

Loading