[#mp_units-get-0a] = xref:mp_units.adoc[mp_units]::get :relfileprefix: ../ :mrdocs: `get` overloads == Synopses Declared in `<mp‐units/ext/type_traits.h>` Returns the non‐type template argument `V`, whose type is `T` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename T, same_as<T> auto V> [[nodiscard]] consteval auto xref:mp_units/get-039.adoc[get](); ---- [.small]#xref:mp_units/get-039.adoc[_» more..._]# Returns a default‐constructed instance of `T1`, given it is a specialization of the class template `T` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< template<typename...> typename T, typename T1> requires is_specialization_of<T1, T> [[nodiscard]] consteval auto xref:mp_units/get-02.adoc[get](); ---- [.small]#xref:mp_units/get-02.adoc[_» more..._]# Returns a default‐constructed instance of `T1`, given it is a specialization of the class template `T` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< template<auto...> typename T, typename T1> requires is_specialization_of_v<T1, T> [[nodiscard]] consteval auto xref:mp_units/get-09.adoc[get](); ---- [.small]#xref:mp_units/get-09.adoc[_» more..._]# Returns the first of the non‐type template arguments `V1, V2, Vs...` whose type matches `T` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename T, auto V1, auto V2, auto Vs...> [[nodiscard]] consteval auto xref:mp_units/get-07.adoc[get](); ---- [.small]#xref:mp_units/get-07.adoc[_» more..._]# Returns a default‐constructed instance of the first of `T1, T2, Ts...` that is a specialization of `T` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< template<typename...> typename T, typename T1, typename T2, typename... Ts> [[nodiscard]] consteval auto xref:mp_units/get-03d.adoc[get](); ---- [.small]#xref:mp_units/get-03d.adoc[_» more..._]# Returns a default‐constructed instance of the first of `T1, T2, Ts...` that is a specialization of `T` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< template<auto...> typename T, typename T1, typename T2, typename... Ts> [[nodiscard]] consteval auto xref:mp_units/get-05.adoc[get](); ---- [.small]#xref:mp_units/get-05.adoc[_» 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 https://en.cppreference.com/cpp/language/attributes/nodiscard[should not be discarded^]. ==== == Template Parameters [cols="1,4"] |=== | Name| Description | *T* | The type that `V` must have | *V* | The non‐type template argument to return | *T1* | The type to return, required to be a specialization of `T` | *V1* | The first non‐type template argument to check | *V2* | The second non‐type template argument to check | *Vs* | The remaining non‐type template arguments to check | *T2* | The second type to check | *Ts* | The remaining types to check |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#