refactor: QuantityValue concept renamed to Representation

This commit is contained in:
Mateusz Pusz
2021-03-19 07:53:18 +01:00
parent 67b2ad5d05
commit 88e642ec74
97 changed files with 197 additions and 197 deletions
+2 -2
View File
@@ -18,7 +18,7 @@ For example the speed of light constant in :term:`SI` is defined as::
namespace si::si2019 {
template<QuantityValue Rep = double>
template<Representation Rep = double>
inline constexpr auto speed_of_light = speed<metre_per_second, Rep>(299792458);
}
@@ -27,7 +27,7 @@ The same constant defined for natural units may be provided as::
namespace natural {
template<QuantityValue Rep = double>
template<Representation Rep = double>
inline constexpr auto speed_of_light = speed<one, Rep>(1);
}
+4 -4
View File
@@ -79,8 +79,8 @@ you can use a quantity argument instead of a quantity kind.
struct height_kind : kind<height_kind, dim_length> {};
struct rate_of_climb_kind : derived_kind<rate_of_climb_kind, height_kind, dim_speed> {};
template <Unit U, QuantityValue Rep = double> using height = quantity_kind<height_kind, U, Rep>;
template <Unit U, QuantityValue Rep = double> using rate_of_climb = quantity_kind<rate_of_climb_kind, U, Rep>;
template <Unit U, Representation Rep = double> using height = quantity_kind<height_kind, U, Rep>;
template <Unit U, Representation Rep = double> using rate_of_climb = quantity_kind<rate_of_climb_kind, U, Rep>;
height h{100 * m};
rate_of_climb rate = h / (25 * s);
@@ -92,8 +92,8 @@ you can use a quantity argument instead of a quantity kind.
struct width_kind : kind<width_kind, dim_length> {};
struct horizontal_area_kind : derived_kind<horizontal_area_kind, width_kind, dim_area> {};
template <Unit U, QuantityValue Rep = double> using width = quantity_kind<width_kind, U, Rep>;
template <Unit U, QuantityValue Rep = double> using horizontal_area = quantity_kind<horizontal_area_kind, U, Rep>;
template <Unit U, Representation Rep = double> using width = quantity_kind<width_kind, U, Rep>;
template <Unit U, Representation Rep = double> using horizontal_area = quantity_kind<horizontal_area_kind, U, Rep>;
width w{5 * m};
horizontal_area area1 = w * w;
+4 -4
View File
@@ -37,10 +37,10 @@ type to ``double`` by default::
namespace si {
template<Unit U, QuantityValue Rep = double>
template<Unit U, Representation Rep = double>
using length = quantity<dim_length, U, Rep>;
template<Unit U, QuantityValue Rep = double>
template<Unit U, Representation Rep = double>
using speed = quantity<dim_speed, U, Rep>;
}
@@ -208,7 +208,7 @@ be used::
All instances of `quantity` class always match the `Quantity` concept.
All other regular types that are not quantities are called
:term:`scalable numbers <scalable number>` by the library and match the
`QuantityValue` concept.
`Representation` concept.
However, the above is not the most important usage of those concepts. Let's
assume that the user wants to implement an ``avg_speed`` function that will
@@ -318,7 +318,7 @@ are provided::
template<typename T>
concept Dimensionless = QuantityOf<T, dim_one>;
template<Unit U, QuantityValue Rep = double>
template<Unit U, Representation Rep = double>
using dimensionless = quantity<dim_one, U, Rep>;
There are two special units provided for usage with such a quantity: