I'm trying to figure out how to write a conecpt that checks that there are no repeated types in a variadic template.
I'm aware I can't call a concept recursively within itself, but if I could my solution would look something like this (ignoring the lack of stop condition):
#include <concepts>
template <class TYPE, class ... TYPE_LIST>
concept is_not_in_list = ((!std::same_as<TYPE, TYPE_LIST>) && ...);
template <class FIRST_TYPE_IN_LIST, class ... REST_OF_TYPE_LIST>
concept is_non_repeating_list_ = (_type_not_in_list_<FIRST_TYPE_IN_LIST, REST_OF_TYPE_LIST> && is_non_repeating_list<REST_OF_TYPE_LIST>);
// Usage
template<is_non_repeating_list ... TYPE_LIST>
class MyClass {}
I can't find a type traits or concepts in the standard library to help me solve this yet. Any thoughts?