forked from mpusz/mp-units
docs: Documentation now prefers refrences over UDLs
This commit is contained in:
@@ -20,8 +20,8 @@ each other and the result will always be a quantity of the same dimension:
|
||||
.. code-block::
|
||||
:emphasize-lines: 3-4
|
||||
|
||||
Length auto dist1 = 2_q_m;
|
||||
Length auto dist2 = 1_q_m;
|
||||
Length auto dist1 = 2 * m;
|
||||
Length auto dist2 = 1 * m;
|
||||
Length auto res1 = dist1 + dist2;
|
||||
Length auto res2 = dist1 - dist2;
|
||||
|
||||
@@ -32,7 +32,7 @@ not change:
|
||||
.. code-block::
|
||||
:emphasize-lines: 2-4
|
||||
|
||||
Length auto dist = 2_q_m;
|
||||
Length auto dist = 2 * m;
|
||||
Length auto res1 = dist * 2; // 4 m
|
||||
Length auto res2 = 3 * res1; // 12 m
|
||||
Length auto res3 = res2 / 2; // 6 m
|
||||
@@ -44,9 +44,9 @@ probably will always end up in a quantity of a yet another dimension:
|
||||
.. code-block::
|
||||
:emphasize-lines: 4-6
|
||||
|
||||
Length auto dist1 = 2_q_m;
|
||||
Length auto dist2 = 3_q_m;
|
||||
Time auto dur1 = 2_q_s;
|
||||
Length auto dist1 = 2 * m;
|
||||
Length auto dist2 = 3 * m;
|
||||
Time auto dur1 = 2 * s;
|
||||
Area auto res1 = dist1 * dist2; // 6 m²
|
||||
Speed auto res2 = dist1 / dur1; // 1 m/s
|
||||
Frequency auto res3 = 10 / dur1; // 5 Hz
|
||||
@@ -58,9 +58,9 @@ dimension, than we will end up with just a dimensionless quantity:
|
||||
.. code-block::
|
||||
:emphasize-lines: 4-5
|
||||
|
||||
Time auto dur1 = 10_q_s;
|
||||
Time auto dur2 = 2_q_s;
|
||||
Frequency auto fr1 = 5_q_Hz;
|
||||
Time auto dur1 = 10 * s;
|
||||
Time auto dur2 = 2 * s;
|
||||
Frequency auto fr1 = 5 * Hz;
|
||||
Dimensionless auto v1 = dur1 / dur2; // quantity(5)
|
||||
Dimensionless auto v2 = dur1 * fr1; // quantity(50)
|
||||
|
||||
@@ -112,8 +112,8 @@ The result will always be a quantity point of the same dimension:
|
||||
.. code-block::
|
||||
:emphasize-lines: 3-5
|
||||
|
||||
Length auto dist1 = 2_q_m;
|
||||
Length auto dist2 = 1_q_m;
|
||||
Length auto dist1 = 2 * m;
|
||||
Length auto dist2 = 1 * m;
|
||||
QuantityPoint auto res1 = quantity_point{dist1} + dist2;
|
||||
QuantityPoint auto res2 = dist1 + quantity_point{dist2};
|
||||
QuantityPoint auto res3 = quantity_point{dist1} - dist2;
|
||||
@@ -124,8 +124,8 @@ The result is a relative quantity of the same dimension:
|
||||
.. code-block::
|
||||
:emphasize-lines: 3
|
||||
|
||||
Length auto dist1 = 2_q_m;
|
||||
Length auto dist2 = 1_q_m;
|
||||
Length auto dist1 = 2 * m;
|
||||
Length auto dist2 = 1 * m;
|
||||
Length auto res1 = quantity_point{dist1} - quantity_point{dist2};
|
||||
|
||||
.. note::
|
||||
@@ -139,11 +139,11 @@ The result is a relative quantity of the same dimension:
|
||||
.. code-block::
|
||||
:emphasize-lines: 3-5
|
||||
|
||||
Length auto dist1 = 2_q_m;
|
||||
Length auto dist2 = 1_q_m;
|
||||
Length auto dist1 = 2 * m;
|
||||
Length auto dist2 = 1 * m;
|
||||
auto res1 = quantity_point{dist1} + quantity_point{dist2}; // ERROR
|
||||
auto res2 = dist1 - quantity_point{dist2}; // ERROR
|
||||
auto res3 = quantity_point{dist1} / 2_q_s; // ERROR
|
||||
auto res3 = quantity_point{dist1} / (2 * s); // ERROR
|
||||
|
||||
Quantity Point Kinds
|
||||
++++++++++++++++++++
|
||||
|
||||
Reference in New Issue
Block a user