mp_units::system_reference

System-specific reference

Synopsis

Declared in <mp-units/framework/system_reference.h>
template<
    QuantitySpec auto Q,
    Unit auto CoU>
requires (!MP_UNITS_ASSOCIATED_UNIT_T(decltype(CoU))) || (CoU == one)
struct system_reference;


Member Functions

Name Description
operator[] Subscript operator

Static Data Members

Name
coherent_unit
quantity_spec

Description

This type is used in rare cases where more than one base quantity in a specific system of units uses the same unit. For example in a hypothetical system of natural units where constant for speed of light c = 1, length and time could be measured in seconds. In such cases system_reference has to be used to explicitly express such a binding.

For example:

{.cpp} // hypothetical natural system of units for c=1 inline constexpr struct second final : named_unit<"s"> {} second; inline constexpr struct minute final : named_unit<"min", mag<60> * second> {} minute; inline constexpr struct gram final : named_unit<"g"> {} gram; inline constexpr auto kilogram = si::kilo; inline constexpr struct time : system_reference {} time; inline constexpr struct length : system_reference {} length; inline constexpr struct speed : system_reference {} speed; inline constexpr struct force : system_reference {} force;

Template Parameters

Name Description
Q quantity for which a unit is being assigned
CoU coherent unit for a quantity in this system

Created with MrDocs