mirror of
https://github.com/mpusz/mp-units.git
synced 2025-07-31 10:57:16 +02:00
refactor: quantity
constructor refactored to use another constructor with the result of sudo_cast
This commit is contained in:
@ -195,8 +195,7 @@ public:
|
|||||||
template<detail::QuantityConvertibleTo<quantity> Q>
|
template<detail::QuantityConvertibleTo<quantity> Q>
|
||||||
// NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions)
|
// NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions)
|
||||||
constexpr explicit(!std::convertible_to<typename Q::rep, Rep>) quantity(const Q& q) :
|
constexpr explicit(!std::convertible_to<typename Q::rep, Rep>) quantity(const Q& q) :
|
||||||
numerical_value_is_an_implementation_detail_(
|
quantity(detail::sudo_cast<quantity>(q))
|
||||||
detail::sudo_cast<quantity>(q).numerical_value_is_an_implementation_detail_)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user