mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-03 12:24:26 +02:00
refactor: zeroth_point_origin()
renamed to default_point_origin()
and implicit_zeroth_point_origin
renamed to zeroth_point_origin
This commit is contained in:
@@ -83,7 +83,7 @@ origin:
|
||||
|
||||
```cpp
|
||||
template<Reference auto R,
|
||||
PointOriginFor<get_quantity_spec(R)> auto PO = zeroth_point_origin(R),
|
||||
PointOriginFor<get_quantity_spec(R)> auto PO = default_point_origin(R),
|
||||
RepresentationOf<get_quantity_spec(R).character> Rep = double>
|
||||
class quantity_point;
|
||||
```
|
||||
@@ -95,7 +95,7 @@ zeroth point using the following rules:
|
||||
|
||||
- if the measurement unit of a quantity specifies its point origin in its definition
|
||||
(e.g., degree Celsius), then this point is being used,
|
||||
- otherwise, an instantiation of `implicit_zeroth_point_origin<QuantitySpec>` is being used which
|
||||
- otherwise, an instantiation of `zeroth_point_origin<QuantitySpec>` is being used which
|
||||
provides a zeroth point for a specific quantity type.
|
||||
|
||||
!!! tip
|
||||
@@ -385,10 +385,12 @@ The above can be used as an origin for subsequent _points_:
|
||||
constexpr quantity_point first_climb_alt = everest_base_camp + isq::altitude(std::uint8_t{42} * m);
|
||||
static_assert(first_climb_alt.quantity_from(everest_base_camp) == 42 * m);
|
||||
static_assert(first_climb_alt.quantity_from(mean_sea_level) == 5406 * m);
|
||||
static_assert(first_climb_alt.quantity_from_zero() == 5406 * m);
|
||||
```
|
||||
|
||||
As we can see above, the `quantity_from()` member function returns a relative distance from the
|
||||
provided point origin.
|
||||
provided point origin while the `quantity_from_zero()` returns the distance from the absolute point
|
||||
origin.
|
||||
|
||||
|
||||
### Converting between different representations of the same _point_
|
||||
|
@@ -277,7 +277,7 @@ The **mp-units** library comes with built-in interoperability with those types.
|
||||
```
|
||||
|
||||
1. `my_origin` is not defined in terms of `chrono_point_origin<Clock>`.
|
||||
2. `implicit_zeroth_point_origin` is not defined in terms of `chrono_point_origin<Clock>`.
|
||||
2. `zeroth_point_origin` is not defined in terms of `chrono_point_origin<Clock>`.
|
||||
|
||||
Here is an example of how interoperability described in this chapter can be used in practice:
|
||||
|
||||
|
@@ -64,23 +64,23 @@ struct relative_point_origin {
|
||||
};
|
||||
|
||||
template<QuantitySpec auto QS>
|
||||
struct implicit_zeroth_point_origin_ : absolute_point_origin<implicit_zeroth_point_origin_<QS>, QS> {};
|
||||
struct zeroth_point_origin_ : absolute_point_origin<zeroth_point_origin_<QS>, QS> {};
|
||||
|
||||
template<QuantitySpec auto QS>
|
||||
inline constexpr implicit_zeroth_point_origin_<QS> implicit_zeroth_point_origin;
|
||||
inline constexpr zeroth_point_origin_<QS> zeroth_point_origin;
|
||||
|
||||
namespace detail {
|
||||
|
||||
template<PointOrigin PO>
|
||||
inline constexpr bool is_specialization_of_implicit_zeroth_point_origin = false;
|
||||
inline constexpr bool is_specialization_of_zeroth_point_origin = false;
|
||||
|
||||
template<auto QS>
|
||||
inline constexpr bool is_specialization_of_implicit_zeroth_point_origin<implicit_zeroth_point_origin_<QS>> = true;
|
||||
inline constexpr bool is_specialization_of_zeroth_point_origin<zeroth_point_origin_<QS>> = true;
|
||||
|
||||
template<PointOrigin PO>
|
||||
[[nodiscard]] consteval bool is_implicit_zeroth_point_origin(PO)
|
||||
[[nodiscard]] consteval bool is_zeroth_point_origin(PO)
|
||||
{
|
||||
return is_specialization_of_implicit_zeroth_point_origin<PO>;
|
||||
return is_specialization_of_zeroth_point_origin<PO>;
|
||||
}
|
||||
|
||||
} // namespace detail
|
||||
@@ -90,7 +90,7 @@ template<PointOrigin PO1, PointOrigin PO2>
|
||||
{
|
||||
if constexpr (detail::AbsolutePointOrigin<PO1> && detail::AbsolutePointOrigin<PO2>)
|
||||
return is_same_v<typename PO1::_type_, typename PO2::_type_> ||
|
||||
(detail::is_implicit_zeroth_point_origin(po1) && detail::is_implicit_zeroth_point_origin(po2) &&
|
||||
(detail::is_zeroth_point_origin(po1) && detail::is_zeroth_point_origin(po2) &&
|
||||
interconvertible(po1.quantity_spec, po2.quantity_spec));
|
||||
else if constexpr (detail::RelativePointOrigin<PO1> && detail::RelativePointOrigin<PO2>)
|
||||
return PO1::quantity_point == PO2::quantity_point;
|
||||
@@ -103,12 +103,12 @@ template<PointOrigin PO1, PointOrigin PO2>
|
||||
}
|
||||
|
||||
template<Reference R>
|
||||
[[nodiscard]] consteval PointOriginFor<get_quantity_spec(R{})> auto zeroth_point_origin(R)
|
||||
[[nodiscard]] consteval PointOriginFor<get_quantity_spec(R{})> auto default_point_origin(R)
|
||||
{
|
||||
if constexpr (requires { get_unit(R{}).point_origin; })
|
||||
return get_unit(R{}).point_origin;
|
||||
else
|
||||
return implicit_zeroth_point_origin<get_quantity_spec(R{})>;
|
||||
return zeroth_point_origin<get_quantity_spec(R{})>;
|
||||
}
|
||||
|
||||
namespace detail {
|
||||
@@ -133,7 +133,7 @@ template<PointOrigin PO>
|
||||
* @tparam PO a type that represents the origin point from which the quantity point is measured from
|
||||
* @tparam Rep a type to be used to represent values of a quantity point
|
||||
*/
|
||||
template<Reference auto R, PointOriginFor<get_quantity_spec(R)> auto PO = zeroth_point_origin(R),
|
||||
template<Reference auto R, PointOriginFor<get_quantity_spec(R)> auto PO = default_point_origin(R),
|
||||
RepresentationOf<get_quantity_spec(R).character> Rep = double>
|
||||
class quantity_point {
|
||||
public:
|
||||
@@ -169,7 +169,7 @@ public:
|
||||
|
||||
template<typename Q>
|
||||
requires QuantityOf<std::remove_cvref_t<Q>, get_quantity_spec(R)> && std::constructible_from<quantity_type, Q> &&
|
||||
(point_origin == zeroth_point_origin(R)) && (implicitly_convertible(Q::quantity_spec, quantity_spec))
|
||||
(point_origin == default_point_origin(R)) && (implicitly_convertible(Q::quantity_spec, quantity_spec))
|
||||
constexpr explicit quantity_point(Q&& q) : quantity_from_origin_is_an_implementation_detail_(std::forward<Q>(q))
|
||||
{
|
||||
}
|
||||
@@ -377,7 +377,7 @@ public:
|
||||
|
||||
// CTAD
|
||||
template<Quantity Q>
|
||||
quantity_point(Q q) -> quantity_point<Q::reference, zeroth_point_origin(Q::reference), typename Q::rep>;
|
||||
quantity_point(Q q) -> quantity_point<Q::reference, default_point_origin(Q::reference), typename Q::rep>;
|
||||
|
||||
template<Quantity Q, PointOriginFor<Q::quantity_spec> PO>
|
||||
quantity_point(Q q, PO) -> quantity_point<Q::reference, PO{}, typename Q::rep>;
|
||||
@@ -396,7 +396,7 @@ template<auto R1, auto PO1, typename Rep1, auto R2, typename Rep2>
|
||||
const quantity<R2, Rep2>& q)
|
||||
requires requires { qp.quantity_ref_from(PO1) + q; }
|
||||
{
|
||||
if constexpr (detail::is_implicit_zeroth_point_origin(PO1))
|
||||
if constexpr (detail::is_zeroth_point_origin(PO1))
|
||||
return quantity_point{qp.quantity_ref_from(PO1) + q};
|
||||
else
|
||||
return quantity_point{qp.quantity_ref_from(PO1) + q, PO1};
|
||||
@@ -433,7 +433,7 @@ template<auto R1, auto PO1, typename Rep1, auto R2, typename Rep2>
|
||||
const quantity<R2, Rep2>& q)
|
||||
requires requires { qp.quantity_ref_from(PO1) - q; }
|
||||
{
|
||||
if constexpr (detail::is_implicit_zeroth_point_origin(PO1))
|
||||
if constexpr (detail::is_zeroth_point_origin(PO1))
|
||||
return quantity_point{qp.quantity_ref_from(PO1) - q};
|
||||
else
|
||||
return quantity_point{qp.quantity_ref_from(PO1) - q, PO1};
|
||||
|
@@ -115,30 +115,28 @@ static_assert(relative_po<absolute_po<isq::height> + 42 * m>.quantity_spec == is
|
||||
inline constexpr struct my_kelvin : named_unit<"my_K", mag<10> * si::kelvin> {
|
||||
} my_kelvin;
|
||||
|
||||
static_assert(zeroth_point_origin(si::kelvin) == si::absolute_zero);
|
||||
static_assert(zeroth_point_origin(si::milli<si::kelvin>) == si::absolute_zero);
|
||||
static_assert(zeroth_point_origin(mag<10> * si::kelvin) == si::absolute_zero);
|
||||
static_assert(zeroth_point_origin(my_kelvin) == si::absolute_zero);
|
||||
static_assert(default_point_origin(si::kelvin) == si::absolute_zero);
|
||||
static_assert(default_point_origin(si::milli<si::kelvin>) == si::absolute_zero);
|
||||
static_assert(default_point_origin(mag<10> * si::kelvin) == si::absolute_zero);
|
||||
static_assert(default_point_origin(my_kelvin) == si::absolute_zero);
|
||||
|
||||
static_assert(zeroth_point_origin(si::degree_Celsius) == si::ice_point);
|
||||
static_assert(zeroth_point_origin(mag<10> * si::degree_Celsius) == si::ice_point);
|
||||
static_assert(default_point_origin(si::degree_Celsius) == si::ice_point);
|
||||
static_assert(default_point_origin(mag<10> * si::degree_Celsius) == si::ice_point);
|
||||
|
||||
static_assert(zeroth_point_origin(si::metre) == implicit_zeroth_point_origin<kind_of<isq::length>>);
|
||||
static_assert(zeroth_point_origin(si::kelvin / si::second) ==
|
||||
implicit_zeroth_point_origin<kind_of<isq::thermodynamic_temperature / isq::time>>);
|
||||
static_assert(zeroth_point_origin(si::degree_Celsius / si::second) ==
|
||||
implicit_zeroth_point_origin<kind_of<isq::thermodynamic_temperature / isq::time>>);
|
||||
static_assert(default_point_origin(si::metre) == zeroth_point_origin<kind_of<isq::length>>);
|
||||
static_assert(default_point_origin(si::kelvin / si::second) ==
|
||||
zeroth_point_origin<kind_of<isq::thermodynamic_temperature / isq::time>>);
|
||||
static_assert(default_point_origin(si::degree_Celsius / si::second) ==
|
||||
zeroth_point_origin<kind_of<isq::thermodynamic_temperature / isq::time>>);
|
||||
|
||||
static_assert(implicit_zeroth_point_origin<isq::length / isq::time> == implicit_zeroth_point_origin<isq::speed>);
|
||||
static_assert(implicit_zeroth_point_origin<inverse(isq::period_duration)> ==
|
||||
implicit_zeroth_point_origin<isq::frequency>);
|
||||
static_assert(implicit_zeroth_point_origin<kind_of<isq::length>> == implicit_zeroth_point_origin<isq::height>);
|
||||
static_assert(implicit_zeroth_point_origin<kind_of<inverse(isq::time)>> ==
|
||||
implicit_zeroth_point_origin<isq::frequency>);
|
||||
static_assert(zeroth_point_origin<isq::length / isq::time> == zeroth_point_origin<isq::speed>);
|
||||
static_assert(zeroth_point_origin<inverse(isq::period_duration)> == zeroth_point_origin<isq::frequency>);
|
||||
static_assert(zeroth_point_origin<kind_of<isq::length>> == zeroth_point_origin<isq::height>);
|
||||
static_assert(zeroth_point_origin<kind_of<inverse(isq::time)>> == zeroth_point_origin<isq::frequency>);
|
||||
|
||||
static_assert(implicit_zeroth_point_origin<isq::length> != implicit_zeroth_point_origin<isq::height>);
|
||||
static_assert(implicit_zeroth_point_origin<isq::width> != implicit_zeroth_point_origin<isq::height>);
|
||||
static_assert(implicit_zeroth_point_origin<inverse(isq::time)> != implicit_zeroth_point_origin<isq::frequency>);
|
||||
static_assert(zeroth_point_origin<isq::length> != zeroth_point_origin<isq::height>);
|
||||
static_assert(zeroth_point_origin<isq::width> != zeroth_point_origin<isq::height>);
|
||||
static_assert(zeroth_point_origin<inverse(isq::time)> != zeroth_point_origin<isq::frequency>);
|
||||
|
||||
/////////////////////
|
||||
// class invariants
|
||||
@@ -159,8 +157,8 @@ concept invalid_types = requires {
|
||||
requires !requires { typename QP<isq::width[m], ground_level, int>; };
|
||||
requires !requires { typename QP<isq::length[m], mean_sea_level, int>; };
|
||||
requires !requires { typename QP<isq::length[m], ground_level, int>; };
|
||||
requires !requires { typename QP<isq::length[m], implicit_zeroth_point_origin<isq::height>, int>; };
|
||||
requires !requires { typename QP<isq::width[m], implicit_zeroth_point_origin<isq::height>, int>; };
|
||||
requires !requires { typename QP<isq::length[m], zeroth_point_origin<isq::height>, int>; };
|
||||
requires !requires { typename QP<isq::width[m], zeroth_point_origin<isq::height>, int>; };
|
||||
// quantity used as Rep
|
||||
requires !requires { typename QP<si::metre, mean_sea_level, quantity<si::metre, int>>; };
|
||||
// quantity point used as Rep
|
||||
@@ -186,9 +184,9 @@ concept valid_types = requires {
|
||||
typename QP<si::metre, ground_level, int>;
|
||||
typename QP<isq::height[m], ground_level, int>;
|
||||
typename QP<special_height[m], ground_level, int>;
|
||||
typename QP<isq::height[m], implicit_zeroth_point_origin<isq::length>, int>;
|
||||
typename QP<isq::height[m], implicit_zeroth_point_origin<kind_of<isq::length>>, int>;
|
||||
typename QP<si::metre, implicit_zeroth_point_origin<isq::height>, int>;
|
||||
typename QP<isq::height[m], zeroth_point_origin<isq::length>, int>;
|
||||
typename QP<isq::height[m], zeroth_point_origin<kind_of<isq::length>>, int>;
|
||||
typename QP<si::metre, zeroth_point_origin<isq::height>, int>;
|
||||
};
|
||||
static_assert(valid_types<quantity_point>);
|
||||
|
||||
@@ -227,17 +225,15 @@ static_assert(quantity_point<si::metre>::reference == si::metre);
|
||||
static_assert(quantity_point<si::metre>::quantity_spec == kind_of<isq::length>);
|
||||
static_assert(quantity_point<si::metre>::dimension == isq::dim_length);
|
||||
static_assert(quantity_point<si::metre>::unit == si::metre);
|
||||
static_assert(is_of_type<quantity_point<si::metre>::point_origin, implicit_zeroth_point_origin_<kind_of<isq::length>>>);
|
||||
static_assert(
|
||||
is_of_type<quantity_point<si::metre>::absolute_point_origin, implicit_zeroth_point_origin_<kind_of<isq::length>>>);
|
||||
static_assert(is_of_type<quantity_point<si::metre>::point_origin, zeroth_point_origin_<kind_of<isq::length>>>);
|
||||
static_assert(is_of_type<quantity_point<si::metre>::absolute_point_origin, zeroth_point_origin_<kind_of<isq::length>>>);
|
||||
|
||||
static_assert(quantity_point<isq::height[m]>::reference == isq::height[m]);
|
||||
static_assert(quantity_point<isq::height[m]>::quantity_spec == isq::height);
|
||||
static_assert(quantity_point<isq::height[m]>::dimension == isq::dim_length);
|
||||
static_assert(quantity_point<isq::height[m]>::unit == si::metre);
|
||||
static_assert(is_of_type<quantity_point<isq::height[m]>::point_origin, implicit_zeroth_point_origin_<isq::height>>);
|
||||
static_assert(
|
||||
is_of_type<quantity_point<isq::height[m]>::absolute_point_origin, implicit_zeroth_point_origin_<isq::height>>);
|
||||
static_assert(is_of_type<quantity_point<isq::height[m]>::point_origin, zeroth_point_origin_<isq::height>>);
|
||||
static_assert(is_of_type<quantity_point<isq::height[m]>::absolute_point_origin, zeroth_point_origin_<isq::height>>);
|
||||
|
||||
static_assert(quantity_point<si::metre, mean_sea_level>::reference == si::metre);
|
||||
static_assert(quantity_point<si::metre, mean_sea_level>::quantity_spec == kind_of<isq::length>);
|
||||
@@ -868,17 +864,17 @@ static_assert(invalid_unit_conversion<quantity_point>);
|
||||
|
||||
static_assert(std::is_same_v<decltype(quantity_point{123 * m})::rep, int>);
|
||||
static_assert(std::is_same_v<std::remove_const_t<decltype(quantity_point{123 * m}.point_origin)>,
|
||||
implicit_zeroth_point_origin_<kind_of<isq::length>>>);
|
||||
zeroth_point_origin_<kind_of<isq::length>>>);
|
||||
static_assert(std::is_same_v<std::remove_const_t<decltype(quantity_point{123 * m}.absolute_point_origin)>,
|
||||
implicit_zeroth_point_origin_<kind_of<isq::length>>>);
|
||||
zeroth_point_origin_<kind_of<isq::length>>>);
|
||||
static_assert(quantity_point{123 * m}.unit == si::metre);
|
||||
static_assert(quantity_point{123 * m}.quantity_spec == kind_of<isq::length>);
|
||||
|
||||
static_assert(std::is_same_v<decltype(quantity_point{isq::height(123 * m)})::rep, int>);
|
||||
static_assert(std::is_same_v<std::remove_const_t<decltype(quantity_point{isq::height(123 * m)}.point_origin)>,
|
||||
implicit_zeroth_point_origin_<isq::height>>);
|
||||
zeroth_point_origin_<isq::height>>);
|
||||
static_assert(std::is_same_v<std::remove_const_t<decltype(quantity_point{isq::height(123 * m)}.absolute_point_origin)>,
|
||||
implicit_zeroth_point_origin_<isq::height>>);
|
||||
zeroth_point_origin_<isq::height>>);
|
||||
static_assert(quantity_point{isq::height(123 * m)}.unit == si::metre);
|
||||
static_assert(quantity_point{isq::height(123 * m)}.quantity_spec == isq::height);
|
||||
|
||||
@@ -1031,37 +1027,30 @@ concept invalid_binary_operations = requires {
|
||||
requires !requires { isq::length(1 * m) + QP<si::metre, mean_sea_level, int>(1 * m); };
|
||||
requires !requires { QP<isq::height[m], mean_sea_level, int>(1 * m) + isq::length(1 * m); };
|
||||
requires !requires { isq::length(1 * m) + QP<isq::height[m], mean_sea_level, int>(1 * m); };
|
||||
requires !requires { QP<si::metre, implicit_zeroth_point_origin<isq::height>, int>(1 * m) + isq::length(1 * m); };
|
||||
requires !requires { isq::length(1 * m) + QP<si::metre, implicit_zeroth_point_origin<isq::height>, int>(1 * m); };
|
||||
requires !requires {
|
||||
QP<isq::height[m], implicit_zeroth_point_origin<isq::height>, int>(1 * m) + isq::length(1 * m);
|
||||
};
|
||||
requires !requires {
|
||||
isq::length(1 * m) + QP<isq::height[m], implicit_zeroth_point_origin<isq::height>, int>(1 * m);
|
||||
};
|
||||
requires !requires { QP<si::metre, zeroth_point_origin<isq::height>, int>(1 * m) + isq::length(1 * m); };
|
||||
requires !requires { isq::length(1 * m) + QP<si::metre, zeroth_point_origin<isq::height>, int>(1 * m); };
|
||||
requires !requires { QP<isq::height[m], zeroth_point_origin<isq::height>, int>(1 * m) + isq::length(1 * m); };
|
||||
requires !requires { isq::length(1 * m) + QP<isq::height[m], zeroth_point_origin<isq::height>, int>(1 * m); };
|
||||
requires !requires { Origin + isq::length(1 * m); };
|
||||
requires !requires { isq::length(1 * m) + Origin; };
|
||||
|
||||
// can't subtract more generic quantity (violates point_origin quantity_spec)
|
||||
requires !requires { QP<si::metre, mean_sea_level, int>(1 * m) - isq::length(1 * m); };
|
||||
requires !requires { QP<isq::height[m], mean_sea_level, int>(1 * m) - isq::length(1 * m); };
|
||||
requires !requires { QP<si::metre, implicit_zeroth_point_origin<isq::height>, int>(1 * m) - isq::length(1 * m); };
|
||||
requires !requires { QP<si::metre, zeroth_point_origin<isq::height>, int>(1 * m) - isq::length(1 * m); };
|
||||
requires !requires { QP<isq::height[m], zeroth_point_origin<isq::height>, int>(1 * m) - isq::length(1 * m); };
|
||||
requires !requires {
|
||||
QP<isq::height[m], implicit_zeroth_point_origin<isq::height>, int>(1 * m) - isq::length(1 * m);
|
||||
};
|
||||
requires !requires {
|
||||
QP<isq::height[m] / isq::time[s], implicit_zeroth_point_origin<isq::height / isq::time>, int>(10 * isq::height[m] /
|
||||
(2 * isq::time[s])) +
|
||||
QP<isq::height[m] / isq::time[s], zeroth_point_origin<isq::height / isq::time>, int>(10 * isq::height[m] /
|
||||
(2 * isq::time[s])) +
|
||||
5 * isq::speed[m / s];
|
||||
};
|
||||
requires !requires {
|
||||
5 * isq::speed[m / s] +
|
||||
QP<isq::height[m] / isq::time[s], implicit_zeroth_point_origin<isq::height / isq::time>, int>(
|
||||
10 * isq::height[m] / (2 * isq::time[s]));
|
||||
5 * isq::speed[m / s] + QP<isq::height[m] / isq::time[s], zeroth_point_origin<isq::height / isq::time>, int>(
|
||||
10 * isq::height[m] / (2 * isq::time[s]));
|
||||
};
|
||||
requires !requires {
|
||||
QP<isq::height[m] / isq::time[s], implicit_zeroth_point_origin<isq::height / isq::time>, int>(10 * isq::height[m] /
|
||||
(2 * isq::time[s])) -
|
||||
QP<isq::height[m] / isq::time[s], zeroth_point_origin<isq::height / isq::time>, int>(10 * isq::height[m] /
|
||||
(2 * isq::time[s])) -
|
||||
5 * isq::speed[m / s];
|
||||
};
|
||||
requires !requires { Origin - isq::length(1 * m); };
|
||||
@@ -1088,23 +1077,23 @@ concept invalid_binary_operations = requires {
|
||||
requires !requires { QP<isq::height[m], mean_sea_level, int>(1 * m) - quantity_point{1 * m}; };
|
||||
requires !requires { quantity_point{1 * m} - QP<isq::height[m], mean_sea_level, int>(1 * m); };
|
||||
requires !requires {
|
||||
QP<isq::width[m], implicit_zeroth_point_origin<isq::width>, int>(1 * m) - quantity_point{isq::height(1 * m)};
|
||||
QP<isq::width[m], zeroth_point_origin<isq::width>, int>(1 * m) - quantity_point{isq::height(1 * m)};
|
||||
};
|
||||
requires !requires {
|
||||
quantity_point{isq::height(1 * m)} - QP<isq::width[m], implicit_zeroth_point_origin<isq::width>, int>(1 * m);
|
||||
quantity_point{isq::height(1 * m)} - QP<isq::width[m], zeroth_point_origin<isq::width>, int>(1 * m);
|
||||
};
|
||||
requires !requires {
|
||||
QP<isq::width[m], implicit_zeroth_point_origin<isq::width>, int>(1 * m) - quantity_point{isq::length(1 * m)};
|
||||
QP<isq::width[m], zeroth_point_origin<isq::width>, int>(1 * m) - quantity_point{isq::length(1 * m)};
|
||||
};
|
||||
requires !requires {
|
||||
quantity_point{isq::length(1 * m)} - QP<isq::width[m], implicit_zeroth_point_origin<isq::width>, int>(1 * m);
|
||||
quantity_point{isq::length(1 * m)} - QP<isq::width[m], zeroth_point_origin<isq::width>, int>(1 * m);
|
||||
};
|
||||
requires !requires {
|
||||
quantity_point{10 * isq::height[m] / (2 * isq::time[s])} -
|
||||
QP<isq::speed[m / s], implicit_zeroth_point_origin<isq::speed>, int>(5 * isq::speed[m / s]);
|
||||
QP<isq::speed[m / s], zeroth_point_origin<isq::speed>, int>(5 * isq::speed[m / s]);
|
||||
};
|
||||
requires !requires {
|
||||
QP<isq::speed[m / s], implicit_zeroth_point_origin<isq::speed>, int>(5 * isq::speed[m / s]) -
|
||||
QP<isq::speed[m / s], zeroth_point_origin<isq::speed>, int>(5 * isq::speed[m / s]) -
|
||||
quantity_point{10 * isq::height[m] / (2 * isq::time[s])};
|
||||
};
|
||||
|
||||
@@ -1554,17 +1543,17 @@ static_assert((quantity_point{5 * isq::speed[m / s]} - 10 * isq::height[m] / (2
|
||||
0 * isq::speed[m / s]);
|
||||
|
||||
static_assert(is_of_type<quantity_point{10 * isq::length[m] / (2 * isq::time[s])} + 5 * isq::speed[m / s],
|
||||
quantity_point<isq::speed[m / s], implicit_zeroth_point_origin<isq::speed>, int>>);
|
||||
quantity_point<isq::speed[m / s], zeroth_point_origin<isq::speed>, int>>);
|
||||
static_assert(is_of_type<10 * isq::height[m] / (2 * isq::time[s]) + quantity_point{5 * isq::speed[m / s]},
|
||||
quantity_point<isq::speed[m / s], implicit_zeroth_point_origin<isq::speed>, int>>);
|
||||
quantity_point<isq::speed[m / s], zeroth_point_origin<isq::speed>, int>>);
|
||||
static_assert(is_of_type<quantity_point{5 * isq::speed[m / s]} + 10 * isq::height[m] / (2 * isq::time[s]),
|
||||
quantity_point<isq::speed[m / s], implicit_zeroth_point_origin<isq::speed>, int>>);
|
||||
quantity_point<isq::speed[m / s], zeroth_point_origin<isq::speed>, int>>);
|
||||
static_assert(is_of_type<5 * isq::speed[m / s] + quantity_point{10 * isq::length[m] / (2 * isq::time[s])},
|
||||
quantity_point<isq::speed[m / s], implicit_zeroth_point_origin<isq::speed>, int>>);
|
||||
quantity_point<isq::speed[m / s], zeroth_point_origin<isq::speed>, int>>);
|
||||
static_assert(is_of_type<quantity_point{10 * isq::length[m] / (2 * isq::time[s])} - 5 * isq::speed[m / s],
|
||||
quantity_point<isq::speed[m / s], implicit_zeroth_point_origin<isq::speed>, int>>);
|
||||
quantity_point<isq::speed[m / s], zeroth_point_origin<isq::speed>, int>>);
|
||||
static_assert(is_of_type<quantity_point{5 * isq::speed[m / s]} - 10 * isq::height[m] / (2 * isq::time[s]),
|
||||
quantity_point<isq::speed[m / s], implicit_zeroth_point_origin<isq::speed>, int>>);
|
||||
quantity_point<isq::speed[m / s], zeroth_point_origin<isq::speed>, int>>);
|
||||
static_assert(
|
||||
is_of_type<quantity_point{10 * isq::length[m] / (2 * isq::time[s])} - quantity_point{5 * isq::speed[m / s]},
|
||||
quantity<isq::speed[m / s], int>>);
|
||||
@@ -1573,9 +1562,8 @@ static_assert(
|
||||
quantity<isq::speed[m / s], int>>);
|
||||
|
||||
static_assert(
|
||||
is_of_type<
|
||||
quantity_point{10 * isq::height[m] / (2 * isq::time[s])} + (10 * isq::height[m] / (2 * isq::time[s])),
|
||||
quantity_point<(isq::height / isq::time)[m / s], implicit_zeroth_point_origin<isq::height / isq::time>, int>>);
|
||||
is_of_type<quantity_point{10 * isq::height[m] / (2 * isq::time[s])} + (10 * isq::height[m] / (2 * isq::time[s])),
|
||||
quantity_point<(isq::height / isq::time)[m / s], zeroth_point_origin<isq::height / isq::time>, int>>);
|
||||
|
||||
inline constexpr struct zero_Hz : absolute_point_origin<zero_Hz, kind_of<isq::frequency>> {
|
||||
} zero_Hz;
|
||||
@@ -1632,17 +1620,17 @@ static_assert(quantity_point{5 * isq::frequency[Hz]} - quantity_point{10 / (2 *
|
||||
0 * isq::frequency[Hz]);
|
||||
|
||||
static_assert(is_of_type<quantity_point{10 / (2 * isq::period_duration[s])} + 5 * isq::frequency[Hz],
|
||||
quantity_point<isq::frequency[Hz], implicit_zeroth_point_origin<isq::frequency>, int>>);
|
||||
quantity_point<isq::frequency[Hz], zeroth_point_origin<isq::frequency>, int>>);
|
||||
static_assert(is_of_type<10 / (2 * isq::period_duration[s]) + quantity_point{5 * isq::frequency[Hz]},
|
||||
quantity_point<isq::frequency[Hz], implicit_zeroth_point_origin<isq::frequency>, int>>);
|
||||
quantity_point<isq::frequency[Hz], zeroth_point_origin<isq::frequency>, int>>);
|
||||
static_assert(is_of_type<quantity_point{5 * isq::frequency[Hz]} + 10 / (2 * isq::period_duration[s]),
|
||||
quantity_point<isq::frequency[Hz], implicit_zeroth_point_origin<isq::frequency>, int>>);
|
||||
quantity_point<isq::frequency[Hz], zeroth_point_origin<isq::frequency>, int>>);
|
||||
static_assert(is_of_type<5 * isq::frequency[Hz] + quantity_point{10 / (2 * isq::period_duration[s])},
|
||||
quantity_point<isq::frequency[Hz], implicit_zeroth_point_origin<isq::frequency>, int>>);
|
||||
quantity_point<isq::frequency[Hz], zeroth_point_origin<isq::frequency>, int>>);
|
||||
static_assert(is_of_type<quantity_point{10 / (2 * isq::period_duration[s])} - 5 * isq::frequency[Hz],
|
||||
quantity_point<isq::frequency[Hz], implicit_zeroth_point_origin<isq::frequency>, int>>);
|
||||
quantity_point<isq::frequency[Hz], zeroth_point_origin<isq::frequency>, int>>);
|
||||
static_assert(is_of_type<quantity_point{5 * isq::frequency[Hz]} - 10 / (2 * isq::period_duration[s]),
|
||||
quantity_point<isq::frequency[Hz], implicit_zeroth_point_origin<isq::frequency>, int>>);
|
||||
quantity_point<isq::frequency[Hz], zeroth_point_origin<isq::frequency>, int>>);
|
||||
static_assert(is_of_type<quantity_point{10 / (2 * isq::period_duration[s])} - quantity_point{5 * isq::frequency[Hz]},
|
||||
quantity<isq::frequency[Hz], int>>);
|
||||
static_assert(is_of_type<quantity_point{5 * isq::frequency[Hz]} - quantity_point{10 / (2 * isq::period_duration[s])},
|
||||
|
Reference in New Issue
Block a user