[#mp_units-unit_for]
= xref:mp_units.adoc[mp&lowbar;units]::unit&lowbar;for
:relfileprefix: ../
:mrdocs:

Public helper that yields the unit associated with a quantity&hyphen;like type&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;typename T&gt;
constexpr auto unit&lowbar;for = detail&colon;&colon;unit&lowbar;for&lowbar;impl&lt;T&gt;&colon;&colon;value;
----

== Description

Derived from the type&apos;s own `&colon;&colon;unit` member (for `quantity` &sol; `quantity&lowbar;point`) or from `quantity&lowbar;like&lowbar;traits&lt;T&gt;` &sol; `quantity&lowbar;point&lowbar;like&lowbar;traits&lt;T&gt;` for external types&period;

This is *not* a customization point&period; Users teach the library about external types by specializing `quantity&lowbar;like&lowbar;traits` &sol; `quantity&lowbar;point&lowbar;like&lowbar;traits`, not this helper&period;

== Template Parameters

[cols="1,4"]
|===
| Name| Description
| *T*
| a quantity&hyphen;like or quantity&hyphen;point&hyphen;like type
|===


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