[#mp_units-get-0a]
= xref:mp_units.adoc[mp&lowbar;units]::get
:relfileprefix: ../
:mrdocs:

`get` overloads

== Synopses

Declared in `&lt;mp&hyphen;units&sol;ext&sol;type&lowbar;traits&period;h&gt;`

Returns the non&hyphen;type template argument `V`, whose type is `T`


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename T,
    same&lowbar;as&lt;T&gt; auto V&gt;
&lsqb;&lsqb;nodiscard&rsqb;&rsqb;
consteval
auto
xref:mp_units/get-039.adoc[get]();
----

[.small]#xref:mp_units/get-039.adoc[_» more&period;&period;&period;_]#

Returns a default&hyphen;constructed instance of `T1`, given it is a specialization of the class template `T`


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    template&lt;typename&period;&period;&period;&gt; typename T,
    typename T1&gt;
requires is&lowbar;specialization&lowbar;of&lt;T1, T&gt;
&lsqb;&lsqb;nodiscard&rsqb;&rsqb;
consteval
auto
xref:mp_units/get-02.adoc[get]();
----

[.small]#xref:mp_units/get-02.adoc[_» more&period;&period;&period;_]#

Returns a default&hyphen;constructed instance of `T1`, given it is a specialization of the class template `T`


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    template&lt;auto&period;&period;&period;&gt; typename T,
    typename T1&gt;
requires is&lowbar;specialization&lowbar;of&lowbar;v&lt;T1, T&gt;
&lsqb;&lsqb;nodiscard&rsqb;&rsqb;
consteval
auto
xref:mp_units/get-09.adoc[get]();
----

[.small]#xref:mp_units/get-09.adoc[_» more&period;&period;&period;_]#

Returns the first of the non&hyphen;type template arguments `V1, V2, Vs&period;&period;&period;` whose type matches `T`


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename T,
    auto V1,
    auto V2,
    auto Vs&period;&period;&period;&gt;
&lsqb;&lsqb;nodiscard&rsqb;&rsqb;
consteval
auto
xref:mp_units/get-07.adoc[get]();
----

[.small]#xref:mp_units/get-07.adoc[_» more&period;&period;&period;_]#

Returns a default&hyphen;constructed instance of the first of `T1, T2, Ts&period;&period;&period;` that is a specialization of `T`


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    template&lt;typename&period;&period;&period;&gt; typename T,
    typename T1,
    typename T2,
    typename&period;&period;&period; Ts&gt;
&lsqb;&lsqb;nodiscard&rsqb;&rsqb;
consteval
auto
xref:mp_units/get-03d.adoc[get]();
----

[.small]#xref:mp_units/get-03d.adoc[_» more&period;&period;&period;_]#

Returns a default&hyphen;constructed instance of the first of `T1, T2, Ts&period;&period;&period;` that is a specialization of `T`


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    template&lt;auto&period;&period;&period;&gt; typename T,
    typename T1,
    typename T2,
    typename&period;&period;&period; Ts&gt;
&lsqb;&lsqb;nodiscard&rsqb;&rsqb;
consteval
auto
xref:mp_units/get-05.adoc[get]();
----

[.small]#xref:mp_units/get-05.adoc[_» more&period;&period;&period;_]#

== Return Value

* The value of `V`
* A default&hyphen;constructed instance of `T1`
* The value of the first argument whose type matches `T`
* A default&hyphen;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&hyphen;type template argument to return
| *T1*
| The type to return, required to be a specialization of `T`
| *V1*
| The first non&hyphen;type template argument to check
| *V2*
| The second non&hyphen;type template argument to check
| *Vs*
| The remaining non&hyphen;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]#
