mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-07 06:04:27 +02:00
fix: RepSafeConstructibleFrom
now works correctly with Arg being rvalue reference
This commit is contained in:
@@ -47,9 +47,9 @@ template<QuantityLike Q>
|
|||||||
using quantity_like_type = quantity<quantity_like_traits<Q>::reference, typename quantity_like_traits<Q>::rep>;
|
using quantity_like_type = quantity<quantity_like_traits<Q>::reference, typename quantity_like_traits<Q>::rep>;
|
||||||
|
|
||||||
template<typename T, typename Arg, auto U>
|
template<typename T, typename Arg, auto U>
|
||||||
concept RepSafeConstructibleFrom =
|
concept RepSafeConstructibleFrom = Unit<std::remove_const_t<decltype(U)>> && std::constructible_from<T, Arg> &&
|
||||||
Unit<std::remove_const_t<decltype(U)>> && std::constructible_from<T, Arg> &&
|
(treat_as_floating_point<T> || (!treat_as_floating_point<std::remove_cvref_t<Arg>> &&
|
||||||
(treat_as_floating_point<T> || (!treat_as_floating_point<Arg> && is_rational(get_canonical_unit(U).mag)));
|
is_rational(get_canonical_unit(U).mag)));
|
||||||
|
|
||||||
template<auto UFrom, auto UTo>
|
template<auto UFrom, auto UTo>
|
||||||
concept IntegralConversionFactor = Unit<decltype(UFrom)> && Unit<decltype(UTo)> &&
|
concept IntegralConversionFactor = Unit<decltype(UFrom)> && Unit<decltype(UTo)> &&
|
||||||
|
Reference in New Issue
Block a user