mp_units::named_unit<Symbol, U>¶
Specialization for unit of a specified base quantity
Synopsis¶
Declared in <mp-units/framework/unit_definitions.h>
template<symbol_text Symbol, Unit auto QS>
requires(!Symbol.empty()) && detail::is_positive_canonical_unit_mag<U>
struct named_unit<Symbol, U> : /* implementation-defined */
Description¶
Associates a unit with a specified base quantity. For example si::metre is a unit to measure isq::length in the SI system.
NOTE
This is the preferred way to define a measurement unit for a specific base quantity.
NOTE
It does not have to (or sometimes even can't) be a proper system's base unit. For example a base unit of mass in the SI is
si::kilogram but here you are about to provide an si::gram and it will work just fine as those two are convertible to each other. A similar case would be the cgs::centimetre that is a base unit for isq::length in the CGS system.
Base Classes¶
| Name | Description |
|---|---|
/* implementation-defined */ |
Type Aliases¶
| Name |
|---|
_base_type_ |
Static Data Members¶
| Name | Description |
|---|---|
_quantity_spec_ | |
_symbol_ | Unique base unit identifier |
Template Parameters¶
| Name | Description |
|---|---|
| Symbol | a short text representation of the unit |
| QuantitySpec | a specification of a base quantity to be measured with this unit |
| Unit | a unit for which we provide a special name |