mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-04 20:54:28 +02:00
test: compile quantity_point_test.cpp
This commit is contained in:
committed by
Mateusz Pusz
parent
fe73c9abe2
commit
c148fffd95
@@ -134,7 +134,7 @@ public:
|
||||
|
||||
template<Quantity Q>
|
||||
[[nodiscard]] friend constexpr QuantityPoint auto operator+(const quantity_point& lhs, const Q& rhs)
|
||||
requires requires { lhs.relative() + rhs; }
|
||||
requires requires(quantity_type q) { q + rhs; }
|
||||
{
|
||||
const auto q = lhs.relative() + rhs;
|
||||
using q_type = decltype(q);
|
||||
@@ -150,7 +150,7 @@ public:
|
||||
|
||||
template<Quantity Q>
|
||||
[[nodiscard]] friend constexpr QuantityPoint auto operator-(const quantity_point& lhs, const Q& rhs)
|
||||
requires requires { lhs.relative() - rhs; }
|
||||
requires requires(quantity_type q) { q - rhs; }
|
||||
{
|
||||
const auto q = lhs.relative() - rhs;
|
||||
using q_type = decltype(q);
|
||||
@@ -159,7 +159,7 @@ public:
|
||||
|
||||
template<QuantityPoint QP>
|
||||
[[nodiscard]] friend constexpr Quantity auto operator-(const quantity_point& lhs, const QP& rhs)
|
||||
requires requires { lhs.relative() - rhs.relative(); }
|
||||
requires requires(quantity_type q) { q - rhs.relative(); }
|
||||
{
|
||||
return lhs.relative() - rhs.relative();
|
||||
}
|
||||
|
Reference in New Issue
Block a user