<mp-units/framework/unit.h>
template<
symbol_text Symbol,
UnitMagnitude auto M,
PrefixableUnit auto U>
requires (!Symbol.empty())
struct prefixed_unit
: ::_base_type_
Name | Description |
---|---|
::_base_type_ |
Name |
---|
_base_type_ |
Name |
---|
_symbol_ |
Defines a new unit that is a scaled version of another unit with the scaling factor specified by a predefined prefix.
For example:
{.cpp}
template
struct kilo_ : prefixed_unit<"k", mag_power<10, 3>, U> {};
template
constexpr kilo_ kilo;
inline constexpr auto kilogram = si::kilo;
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 |