GuillaumeDua / CppShelf

Collection of powerfuls - C++ Single-Header Libraries Files
https://guillaumedua.github.io/CppShelf/
MIT License
9 stars 1 forks source link

[mp] make type_traits available as concepts #180

Open GuillaumeDua opened 7 months ago

GuillaumeDua commented 7 months ago

Example:

namespace csl::mp::concepts {
  template <typename T, typename... Ts>
  concept one_of = (false or ... or std::same_as<T, Ts>);
}

vs.

namespace csl::mp::concepts {
  template <typename T, typename... Ts>
  concept one_of = type_traits::one_of_v<T, pack<Ts...>>);
}