GuillaumeDua / CppShelf

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

[mp] contains #175

Open GuillaumeDua opened 9 months ago

GuillaumeDua commented 9 months ago
// contains
// any_of + bind std::disjunction<std::is_same<T>>
template <typename T, typename U>
struct contains;
template <template <typename...> typename pack, typename ... Ts, typename T>
struct contains<pack<Ts...>, T> : std::integral_constant<bool, (std::is_same_v<Ts, T> or ...)>
{};
template <typename T, typename U>
constexpr auto contains_v = contains<T, U>::value;