mp_units::get

get overloads

Synopses

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

Returns the non-type template argument V, whose type is T

template<
    typename T,
    same_as<T> auto V>
[[nodiscard]]
consteval
auto
get();
» more...

Returns a default-constructed instance of T1, given it is a specialization of the class template T

template<
    template<typename...> typename T,
    typename T1>
requires is_specialization_of<T1, T>
[[nodiscard]]
consteval
auto
get();
» more...

Returns a default-constructed instance of T1, given it is a specialization of the class template T

template<
    template<auto...> typename T,
    typename T1>
requires is_specialization_of_v<T1, T>
[[nodiscard]]
consteval
auto
get();
» more...

Returns the first of the non-type template arguments V1, V2, Vs... whose type matches T

template<
    typename T,
    auto V1,
    auto V2,
    auto Vs...>
[[nodiscard]]
consteval
auto
get();
» more...

Returns a default-constructed instance of the first of T1, T2, Ts... that is a specialization of T

template<
    template<typename...> typename T,
    typename T1,
    typename T2,
    typename... Ts>
[[nodiscard]]
consteval
auto
get();
» more...

Returns a default-constructed instance of the first of T1, T2, Ts... that is a specialization of T

template<
    template<auto...> typename T,
    typename T1,
    typename T2,
    typename... Ts>
[[nodiscard]]
consteval
auto
get();
» more...

Return Value

  • The value of V
  • A default-constructed instance of T1
  • The value of the first argument whose type matches T
  • A default-constructed instance of the first matching type

NOTE

The return value should not be discarded.

Template Parameters

NameDescription
TThe type that V must have
VThe non-type template argument to return
T1The type to return, required to be a specialization of T
V1The first non-type template argument to check
V2The second non-type template argument to check
VsThe remaining non-type template arguments to check
T2The second type to check
TsThe remaining types to check