mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-04 12:54:25 +02:00
fix: check requirement early
This commit is contained in:
committed by
Mateusz Pusz
parent
69fac6b695
commit
5f135d11bb
@@ -83,9 +83,9 @@ struct one_rep {
|
||||
[[nodiscard]] friend constexpr Rep operator/(one_rep, const Rep&) = delete;
|
||||
|
||||
template<typename Rep>
|
||||
requires requires { quantity_values<Rep>::one(); }
|
||||
[[nodiscard]] constexpr operator Rep() const noexcept
|
||||
{
|
||||
static_assert(QuantityValue<Rep>);
|
||||
return quantity_values<Rep>::one();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user