A prefixed unit
Declared in <mp-units/framework/unit_definitions.h>
template<
symbol_text Symbol,
UnitMagnitude auto M,
PrefixableUnit auto U>
requires (!Symbol.empty() && M != mag<1>)
struct prefixed_unit
: /* implementation-defined */
Defines a new unit that is a scaled version of another unit with the scaling factor specified by a predefined prefix.
For example:
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>;
| Name | Description |
|---|---|
/* implementation-defined */ |
| Name | Description |
|---|---|
_base_type_ | Exposition-only alias naming this specialization's base type. |
| Name | Description |
|---|---|
_mag_ | |
_reference_unit_ | |
_symbol_ | The prefixed unit's symbol, formed by prepending Symbol to U's symbol |
| 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 |