refactor: type_traits usage cleanup

This commit is contained in:
Mateusz Pusz
2023-06-12 11:37:39 +03:00
parent 4092700cf9
commit bb158a69e9

View File

@@ -109,7 +109,8 @@ struct quantity_spec_interface {
template<typename Self, typename Q>
[[nodiscard]] constexpr Quantity auto operator()(this Self self, Q&& q) const
requires Quantity<std::remove_cvref_t<Q>> && (explicitly_convertible(std::remove_cvref_t<Q>::quantity_spec, self))
requires Quantity<std::remove_cvref_t<Q>> &&
(explicitly_convertible(std::remove_reference_t<Q>::quantity_spec, self))
{
return make_quantity<reference<self, std::remove_cvref_t<Q>::unit>{}>(std::forward<Q>(q).number());
}
@@ -121,7 +122,8 @@ struct quantity_spec_interface {
}
template<typename Q>
requires Quantity<std::remove_cvref_t<Q>> && (explicitly_convertible(std::remove_cvref_t<Q>::quantity_spec, Self{}))
requires Quantity<std::remove_cvref_t<Q>> &&
(explicitly_convertible(std::remove_reference_t<Q>::quantity_spec, Self{}))
[[nodiscard]] constexpr Quantity auto operator()(Q&& q) const
{
return make_quantity<reference<Self{}, std::remove_cvref_t<Q>::unit>{}>(std::forward<Q>(q).number());
@@ -296,7 +298,8 @@ struct quantity_spec<Self, QS, Args...> : std::remove_const_t<decltype(QS)> {
}
template<typename Q>
requires Quantity<std::remove_cvref_t<Q>> && (explicitly_convertible(std::remove_cvref_t<Q>::quantity_spec, Self{}))
requires Quantity<std::remove_cvref_t<Q>> &&
(explicitly_convertible(std::remove_reference_t<Q>::quantity_spec, Self{}))
[[nodiscard]] constexpr Quantity auto operator()(Q&& q) const
{
return make_quantity<reference<Self{}, std::remove_cvref_t<Q>::unit>{}>(std::forward<Q>(q).number());