[#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&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())
struct prefixed&lowbar;unit
    : ::&lowbar;base&lowbar;type&lowbar;
----

== 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]
----
{.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
| `::&lowbar;base&lowbar;type&lowbar;`
| 
|===

== Type Aliases

[cols="1"]
|===
| Name
| xref:mp_units/prefixed_unit/_base_type_.adoc[`&lowbar;base&lowbar;type&lowbar;`] 
|===


== Static Data Members

[cols="1"]
|===
| Name
| xref:mp_units/prefixed_unit/_symbol_.adoc[`&lowbar;symbol&lowbar;`] 
|===


== 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]#
