mp_units::contains

contains overloads

Synopses

Declared in <mp-units/ext/type_traits.h>

Checks whether the type T matches the type of any of the non-type template arguments Vs

template<
    typename T,
    auto Vs...>
[[nodiscard]]
consteval
bool
contains();
» more...

Checks whether any of the types Ts is a specialization of the class template T

template<
    template<typename...> typename T,
    typename... Ts>
[[nodiscard]]
consteval
bool
contains();
» more...

Checks whether any of the types Ts is a specialization of the class template T

template<
    template<auto...> typename T,
    typename... Ts>
[[nodiscard]]
consteval
bool
contains();
» more...

Checks whether the type T is present in the type pack T1, Ts...

template<
    typename T,
    typename T1,
    typename... Ts>
[[nodiscard]]
consteval
bool
contains();
» more...

Return Value

  • true if T matches the type of at least one of Vs, false otherwise
  • true if at least one of Ts is a specialization of T, false otherwise
  • true if T is the same as T1 or one of Ts, false otherwise

NOTE

The return value should not be discarded.

Template Parameters

NameDescription
TThe type to look for among the types of Vs
VsThe non-type template arguments whose types are checked against T
TsThe types to check
T1The first type of the pack to search