mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-04 04:44:27 +02:00
refactor: reference
returns auto
to improve compilation times
This commit is contained in:
@@ -112,7 +112,7 @@ struct reference {
|
|||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]] friend consteval detail::reference_t<inverse(Q{}), inverse(U{})> inverse(reference) { return {}; }
|
[[nodiscard]] friend consteval auto inverse(reference) { return detail::reference_t<inverse(Q{}), inverse(U{})>{}; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Computes the value of a reference raised to the `Num/Den` power
|
* @brief Computes the value of a reference raised to the `Num/Den` power
|
||||||
@@ -125,9 +125,9 @@ struct reference {
|
|||||||
*/
|
*/
|
||||||
template<std::intmax_t Num, std::intmax_t Den = 1>
|
template<std::intmax_t Num, std::intmax_t Den = 1>
|
||||||
requires detail::non_zero<Den>
|
requires detail::non_zero<Den>
|
||||||
[[nodiscard]] friend consteval detail::reference_t<pow<Num, Den>(Q{}), pow<Num, Den>(U{})> pow(reference)
|
[[nodiscard]] friend consteval auto pow(reference)
|
||||||
{
|
{
|
||||||
return {};
|
return detail::reference_t<pow<Num, Den>(Q{}), pow<Num, Den>(U{})>{};
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -137,7 +137,7 @@ struct reference {
|
|||||||
*
|
*
|
||||||
* @return The result of computation
|
* @return The result of computation
|
||||||
*/
|
*/
|
||||||
[[nodiscard]] friend consteval detail::reference_t<sqrt(Q{}), sqrt(U{})> sqrt(reference) { return {}; }
|
[[nodiscard]] friend consteval auto sqrt(reference) { return detail::reference_t<sqrt(Q{}), sqrt(U{})>{}; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Computes the cubic root of a reference
|
* @brief Computes the cubic root of a reference
|
||||||
@@ -146,7 +146,7 @@ struct reference {
|
|||||||
*
|
*
|
||||||
* @return The result of computation
|
* @return The result of computation
|
||||||
*/
|
*/
|
||||||
[[nodiscard]] friend consteval detail::reference_t<cbrt(Q{}), cbrt(U{})> cbrt(reference) { return {}; }
|
[[nodiscard]] friend consteval auto cbrt(reference) { return detail::reference_t<cbrt(Q{}), cbrt(U{})>{}; }
|
||||||
|
|
||||||
template<typename Q2, typename U2>
|
template<typename Q2, typename U2>
|
||||||
[[nodiscard]] friend consteval bool convertible(reference, reference<Q2, U2>)
|
[[nodiscard]] friend consteval bool convertible(reference, reference<Q2, U2>)
|
||||||
|
Reference in New Issue
Block a user