mp_units::named_unit<Symbol, U>

Specialization for unit of a specified base quantity

Synopsis

Declared in <mp-units/framework/unit.h>
template<
    symbol_text Symbol,
    Unit auto QS>
requires (!Symbol.empty())
struct named_unit<Symbol, U>
    : /* implementation-defined */


Base Classes

Name Description
/* implementation-defined */

Types

Name
_base_type_

Static Data Members

Name Description
_quantity_spec_
_symbol_ Unique base unit identifier

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.

Allows assigning a special name to another scaled or derived unit (e.g. hour, joule).

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

Created with MrDocs