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

Computes the canonical form of a unit

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lsqb;&lsqb;nodiscard&rsqb;&rsqb;
consteval
auto
get&lowbar;canonical&lowbar;unit(auto u);
----

== Description

The canonical form reduces a unit to its reference unit expressed only in terms of base units together with the unit magnitude needed to reach it, so that units can be compared for compatibility and converted between each other&period;

== Return Value

the canonical form of `u`

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

[cols="1,4"]
|===
| Name| Description
| *u*
| unit to compute the canonical form of
|===


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