[#mp_units-get_common_quantity_spec-08]
= xref:mp_units.adoc[mp&lowbar;units]::get&lowbar;common&lowbar;quantity&lowbar;spec
:relfileprefix: ../
:mrdocs:

`get&lowbar;common&lowbar;quantity&lowbar;spec` overloads

== Synopses

Declared in `&lt;mp&hyphen;units&sol;framework&sol;quantity&lowbar;spec&lowbar;conversion&period;h&gt;`

Returns the common quantity specification of a single quantity specification


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lsqb;&lsqb;nodiscard&rsqb;&rsqb;
consteval
xref:mp_units/QuantitySpec.adoc[QuantitySpec] auto
xref:mp_units/get_common_quantity_spec-04.adoc[get&lowbar;common&lowbar;quantity&lowbar;spec](auto q);
----

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

Returns the common quantity specification of two quantity specifications


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    xref:mp_units/QuantitySpec.adoc[QuantitySpec] Q1,
    xref:mp_units/QuantitySpec.adoc[QuantitySpec] Q2&gt;
requires (detail&colon;&colon;have&lowbar;common&lowbar;quantity&lowbar;spec(Q1&lcub;&rcub;, Q2&lcub;&rcub;))
&lsqb;&lsqb;nodiscard&rsqb;&rsqb;
consteval
xref:mp_units/QuantitySpec.adoc[QuantitySpec] auto
xref:mp_units/get_common_quantity_spec-0b.adoc[get&lowbar;common&lowbar;quantity&lowbar;spec](
    Q1 q1,
    Q2 q2);
----

[.small]#xref:mp_units/get_common_quantity_spec-0b.adoc[_» more&period;&period;&period;_]#

Returns the common quantity specification of three or more quantity specifications


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lsqb;&lsqb;nodiscard&rsqb;&rsqb;
consteval
xref:mp_units/QuantitySpec.adoc[QuantitySpec] auto
xref:mp_units/get_common_quantity_spec-0a.adoc[get&lowbar;common&lowbar;quantity&lowbar;spec](
    auto q1,
    auto q2,
    auto q3,
    auto&period;&period;&period; rest)
requires requires &lcub; mp&lowbar;units&colon;&colon;get&lowbar;common&lowbar;quantity&lowbar;spec(mp&lowbar;units&colon;&colon;get&lowbar;common&lowbar;quantity&lowbar;spec(q1, q2), q3, rest&period;&period;&period;)&semi; &rcub;;
----

[.small]#xref:mp_units/get_common_quantity_spec-0a.adoc[_» more&period;&period;&period;_]#

== Return Value

* `q` unchanged
* the strongest quantity specification that both arguments are convertible to
* the common quantity specification obtained by folding all arguments pairwise

[NOTE]
====
The return value https://en.cppreference.com/cpp/language/attributes/nodiscard[should not be discarded^].
====
== Template Parameters

[cols="1,4"]
|===
| Name| Description
| *Q1*
| first quantity specification type
| *Q2*
| second quantity specification type
|===

== Parameters

[cols="1,4"]
|===
| Name| Description
| *q*
| a quantity specification value
| *q1*
| first quantity specification value
| *q2*
| second quantity specification value
| *q3*
| third quantity specification value
| *rest*
| any remaining quantity specification values
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
