[#mp_units-get_common_unit-02]
= xref:mp_units.adoc[mp&lowbar;units]::get&lowbar;common&lowbar;unit
:relfileprefix: ../
:mrdocs:

Computes the common unit of three or more units

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lsqb;&lsqb;nodiscard&rsqb;&rsqb;
consteval
xref:mp_units/Unit.adoc[Unit] auto
get&lowbar;common&lowbar;unit(
    auto u1,
    auto u2,
    auto u3,
    auto&period;&period;&period; rest)
requires requires &lcub; mp&lowbar;units&colon;&colon;get&lowbar;common&lowbar;unit(mp&lowbar;units&colon;&colon;get&lowbar;common&lowbar;unit(u1, u2), u3, rest&period;&period;&period;)&semi; &rcub;;
----

== Return Value

the common unit obtained by folding `get&lowbar;common&lowbar;unit` over `u1,` `u2,` `u3,` and `rest`

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

[cols="1,4"]
|===
| Name| Description
| *u1*
| first unit
| *u2*
| second unit
| *u3*
| third unit
| *rest*
| remaining units, if any
|===


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