feat: users are now allowed to inherit their ow types from absolute point origins

This commit is contained in:
Mateusz Pusz committed 2023-12-03 16:15:38 +01:00
1 parent 611e380ed4
commit da8721b997
11 files changed
+133 -61

No files matched your search

@@ -28,8 +28,11 @@
namespace mp_units::si {
// clang-format off
inline constexpr struct absolute_zero : absolute_point_origin<isq::thermodynamic_temperature> {} absolute_zero;
inline constexpr struct absolute_zero : absolute_point_origin<absolute_zero, isq::thermodynamic_temperature> {} absolute_zero;
inline constexpr struct zeroth_kelvin : decltype(absolute_zero) {} zeroth_kelvin;
inline constexpr struct ice_point : relative_point_origin<absolute_zero + 273.15 * kelvin> {} ice_point;
inline constexpr struct zeroth_degree_Celsius : decltype(ice_point) {} zeroth_degree_Celsius;
// clang-format on
} // namespace mp_units::si
@@ -112,7 +112,7 @@ inline constexpr struct inch_of_mercury : named_unit<"inHg", mag<ratio(3'386'389
// https://en.wikipedia.org/wiki/United_States_customary_units#Temperature
inline constexpr struct degree_Fahrenheit : named_unit<basic_symbol_text{"°F", "`F"}, mag<ratio{5, 9}> * si::degree_Celsius> {} degree_Fahrenheit;
inline constexpr struct zero_Fahrenheit : relative_point_origin<si::ice_point - 32 * degree_Fahrenheit> {} zero_Fahrenheit;
inline constexpr struct zero_Fahrenheit : relative_point_origin<si::zeroth_degree_Celsius - 32 * degree_Fahrenheit> {} zero_Fahrenheit;
// clang-format on
namespace unit_symbols {