refactor: quantity constructor refactored to use another constructor with the result of sudo_cast

This commit is contained in:
Mateusz Pusz
2024-12-04 20:08:02 +01:00
parent 7e789bc1f1
commit 971197b9e5

View File

@ -195,8 +195,7 @@ public:
template<detail::QuantityConvertibleTo<quantity> Q>
// NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions)
constexpr explicit(!std::convertible_to<typename Q::rep, Rep>) quantity(const Q& q) :
numerical_value_is_an_implementation_detail_(
detail::sudo_cast<quantity>(q).numerical_value_is_an_implementation_detail_)
quantity(detail::sudo_cast<quantity>(q))
{
}