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

Computes the common unit of a single new unit and a `common&lowbar;unit` compound

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    xref:mp_units/Unit.adoc[Unit]&period;&period;&period; Us,
    &sol;&ast; implementation-defined &ast;&sol; NewUnit&gt;
&lsqb;&lsqb;nodiscard&rsqb;&rsqb;
consteval
xref:mp_units/Unit.adoc[Unit] auto
get&lowbar;common&lowbar;unit(
    NewUnit nu,
    xref:mp_units/common_unit.adoc[common&lowbar;unit&lt;Us&period;&period;&period;&gt;] cu);
----

== Return Value

the common unit obtained by merging `nu` into `cu&apos;s` unit list

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

[cols="1,4"]
|===
| Name| Description
| *nu*
| the single unit
| *cu*
| the `common&lowbar;unit` compound
|===


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