[#mp_units-system_reference]
= xref:mp_units.adoc[mp&lowbar;units]::system&lowbar;reference
:relfileprefix: ../
:mrdocs:

System&hyphen;specific reference

== Synopsis

Declared in `&lt;mp&hyphen;units&sol;framework&sol;system&lowbar;reference&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    xref:mp_units/QuantitySpec.adoc[QuantitySpec] auto Q,
    xref:mp_units/Unit.adoc[Unit] auto CoU&gt;
requires (!MP&lowbar;UNITS&lowbar;ASSOCIATED&lowbar;UNIT&lowbar;T(decltype(CoU))) &verbar;&verbar; (CoU &equals;&equals; one)
struct system&lowbar;reference;
----

== Member Functions

[cols=2]
|===
| Name
| Description
| xref:mp_units/system_reference/operator_subs.adoc[`operator&lsqb;&rsqb;`] 
| Subscript operator
|===

== Static Data Members

[cols=1]
|===
| Name
| xref:mp_units/system_reference/coherent_unit.adoc[`coherent&lowbar;unit`] 
| xref:mp_units/system_reference/quantity_spec.adoc[`quantity&lowbar;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&period; For example in a hypothetical system of natural units where constant for speed of light `c &equals; 1`, length and time could be measured in seconds&period; In such cases `system&lowbar;reference` has to be used to explicitly express such a binding&period;

For example&colon;

[,cpp]
----
{.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<gram>;

 inline constexpr struct time : system_reference<isq::time, second> {} time;
 inline constexpr struct length : system_reference<isq::length, second> {} length;
 inline constexpr struct speed : system_reference<isq::speed, second / second> {} speed;
 inline constexpr struct force : system_reference<isq::force, kilogram / second> {} force;
----
== Template Parameters

[cols=2]
|===
| Name
| Description
| *Q*
| quantity for which a unit is being assigned
| *CoU*
| coherent unit for a quantity in this system
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
