mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-03 20:34:26 +02:00
Concepts workaround added to operator/()
This commit is contained in:
@@ -258,9 +258,9 @@ namespace units {
|
|||||||
|
|
||||||
// template<Dimension D, Unit U, Scalar Rep1, Scalar Rep2>
|
// template<Dimension D, Unit U, Scalar Rep1, Scalar Rep2>
|
||||||
template<typename D, typename U, typename Rep1, typename Rep2>
|
template<typename D, typename U, typename Rep1, typename Rep2>
|
||||||
requires !Quantity<Rep2>
|
[[nodiscard]] constexpr Quantity operator*(const quantity<D, U, Rep1>& q,
|
||||||
/* [[nodiscard]]*/ constexpr Quantity operator*(const quantity<D, U, Rep1>& q,
|
|
||||||
const Rep2& v)
|
const Rep2& v)
|
||||||
|
requires (!Quantity<Rep2>)
|
||||||
{
|
{
|
||||||
using common_rep = decltype(q.count()* v);
|
using common_rep = decltype(q.count()* v);
|
||||||
using ret = quantity<D, U, common_rep>;
|
using ret = quantity<D, U, common_rep>;
|
||||||
@@ -269,9 +269,9 @@ namespace units {
|
|||||||
|
|
||||||
//template<Scalar Rep1, Dimension D, Unit U, Scalar Rep2>
|
//template<Scalar Rep1, Dimension D, Unit U, Scalar Rep2>
|
||||||
template<typename Rep1, typename D, typename U, typename Rep2>
|
template<typename Rep1, typename D, typename U, typename Rep2>
|
||||||
requires !Quantity<Rep1>
|
[[nodiscard]] constexpr Quantity operator*(const Rep1& v,
|
||||||
/* [[nodiscard]]*/ constexpr Quantity operator*(const Rep1& v,
|
|
||||||
const quantity<D, U, Rep2>& q)
|
const quantity<D, U, Rep2>& q)
|
||||||
|
requires (!Quantity<Rep1>)
|
||||||
{
|
{
|
||||||
return q * v;
|
return q * v;
|
||||||
}
|
}
|
||||||
@@ -292,6 +292,7 @@ namespace units {
|
|||||||
template<typename Rep1, typename D, typename U, typename Rep2>
|
template<typename Rep1, typename D, typename U, typename Rep2>
|
||||||
[[nodiscard]] constexpr Quantity operator/(const Rep1& v,
|
[[nodiscard]] constexpr Quantity operator/(const Rep1& v,
|
||||||
const quantity<D, U, Rep2>& q)
|
const quantity<D, U, Rep2>& q)
|
||||||
|
requires (!Quantity<Rep1>)
|
||||||
{
|
{
|
||||||
Expects(q != std::decay_t<decltype(q)>(0));
|
Expects(q != std::decay_t<decltype(q)>(0));
|
||||||
|
|
||||||
@@ -306,6 +307,7 @@ namespace units {
|
|||||||
template<typename D, typename U, typename Rep1, typename Rep2>
|
template<typename D, typename U, typename Rep1, typename Rep2>
|
||||||
[[nodiscard]] constexpr Quantity operator/(const quantity<D, U, Rep1>& q,
|
[[nodiscard]] constexpr Quantity operator/(const quantity<D, U, Rep1>& q,
|
||||||
const Rep2& v)
|
const Rep2& v)
|
||||||
|
requires (!Quantity<Rep2>)
|
||||||
{
|
{
|
||||||
Expects(v != Rep2{0});
|
Expects(v != Rep2{0});
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user