Skip to content

mp_units::named_unit<Symbol, U, QS, Prop, Props...>

Specialization for a unit with special name valid only for a specific quantity

Synopsis

Declared in <mp-units/framework/unit_definitions.h>

template<symbol_text Symbol, Unit auto U,
         /* implementation-defined */ auto QS,
         /* implementation-defined */ auto Prop,
         /* implementation-defined */ auto Props...>
  requires(!Symbol.empty()) &&
          (detail::dimension_of<decltype(QS)> ==
           detail::dimension_of<decltype(auto(
             detail::get_associated_quantity(U)))>) &&
          detail::is_positive_canonical_unit_mag<U>
struct named_unit<Symbol, U, QS, Prop, Props...>;

Description

The same as the above but additionally limits the usage of this unit to provided quantities.

Template Parameters

NameDescription
Symbola short text representation of the unit
Unita unit for which we provide a special name
QuantitySpeca specification of a quantity to be measured with this unit
Propsoptionally, in any order, a point origin and no_space_before_unit_symbol