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

A prefixed unit

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    xref:mp_units/symbol_text-032.adoc[symbol&lowbar;text] Symbol,
    xref:mp_units/UnitMagnitude.adoc[UnitMagnitude] auto M,
    xref:mp_units/PrefixableUnit.adoc[PrefixableUnit] auto U&gt;
requires (!Symbol&period;empty() &amp;&amp; M !&equals; mag&lt;1&gt;)
struct prefixed&lowbar;unit
    : &sol;&ast; implementation-defined &ast;&sol;
----

== Description

Defines a new unit that is a scaled version of another unit with the scaling factor specified by a predefined prefix&period;

For example&colon;

[,cpp]
----
template<PrefixableUnit auto U>
struct kilo_ : prefixed_unit<"k", mag_power<10, 3>, U> {};

template<PrefixableUnit auto U>
constexpr kilo_<U> kilo;

inline constexpr auto kilogram = si::kilo<gram>;
----
== Base Classes

[cols="1,4"]
|===
| Name| Description
| `&sol;&ast; implementation-defined &ast;&sol;`
| 
|===

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:mp_units/prefixed_unit/_base_type_.adoc[`&lowbar;base&lowbar;type&lowbar;`] 
| Exposition&hyphen;only alias naming this specialization&apos;s base type&period;
|===


== Static Data Members

[cols="1,4"]
|===
| Name| Description
| xref:mp_units/prefixed_unit/_mag_.adoc[`&lowbar;mag&lowbar;`] 
| 
| xref:mp_units/prefixed_unit/_reference_unit_.adoc[`&lowbar;reference&lowbar;unit&lowbar;`] 
| 
| xref:mp_units/prefixed_unit/_symbol_.adoc[`&lowbar;symbol&lowbar;`] 
| The prefixed unit&apos;s symbol, formed by prepending `Symbol` to `U&apos;s` symbol
|===


== Template Parameters

[cols="1,4"]
|===
| Name| Description
| *Symbol*
| a prefix text to prepend to a unit symbol
| *M*
| scaling factor of the prefix
| *U*
| a named unit to be prefixed
|===


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