fix: some fixes revealed during clang compilation
This commit is contained in:
1 parent
3cc653fae1
commit
624b7c7404
10 files changed
+16
-13
No files matched your search
@@ -46,11 +46,12 @@ namespace mp_units {
|
||||
* @tparam ToQS a quantity specification to use for a target quantity
|
||||
*/
|
||||
template<QuantitySpec auto ToQS, typename Q>
|
||||
requires Quantity<std::remove_cvref_t<Q>> && (castable(Q::quantity_spec, ToQS))
|
||||
[[nodiscard]] constexpr Quantity auto quantity_cast(Q&& q)
|
||||
requires Quantity<std::remove_cvref_t<Q>> && (castable(q.quantity_spec, ToQS))
|
||||
{
|
||||
if constexpr (detail::QuantityKindSpec<std::remove_const_t<decltype(ToQS)>> &&
|
||||
AssociatedUnit<std::remove_const_t<decltype(q.unit)>>)
|
||||
AssociatedUnit<std::remove_const_t<decltype(Q::unit)>>)
|
||||
return make_quantity<q.unit>(std::forward<Q>(q).value());
|
||||
else
|
||||
return make_quantity<reference<ToQS, q.unit>{}>(std::forward<Q>(q).value());
|
||||
|
||||
@@ -62,7 +62,6 @@ inline constexpr bool is_derived_from_specialization_of_quantity_spec =
|
||||
|
||||
#ifdef __cpp_explicit_this_parameter
|
||||
template<BaseDimension auto Dim, auto... Args>
|
||||
template<auto... Args>
|
||||
void to_base_specialization_of_base_quantity_spec(const volatile quantity_spec<Dim, Args...>*);
|
||||
#else
|
||||
template<typename Self, BaseDimension auto Dim, auto... Args>
|
||||
|
||||
@@ -448,7 +448,7 @@ template<Unit Lhs, Unit Rhs>
|
||||
return detail::expr_divide<derived_unit, struct one, detail::type_list_of_unit_less>(lhs, rhs);
|
||||
}
|
||||
|
||||
[[nodiscard]] consteval Unit auto operator/(int value, Unit auto u)
|
||||
[[nodiscard]] MP_UNITS_CONSTEVAL Unit auto operator/(int value, Unit auto u)
|
||||
{
|
||||
gsl_Expects(value == 1);
|
||||
return detail::expr_invert<derived_unit, struct one>(u);
|
||||
@@ -720,7 +720,7 @@ constexpr Out unit_symbol_impl(Out out, const scaled_unit<M, U>& u, unit_symbol_
|
||||
constexpr auto mag_txt = magnitude_text<M>();
|
||||
out = copy<CharT>(mag_txt, fmt.encoding, out);
|
||||
|
||||
if constexpr (has_unit_symbol(u.reference_unit)) {
|
||||
if constexpr (has_unit_symbol(scaled_unit<M, U>::reference_unit)) {
|
||||
*out++ = ' ';
|
||||
return unit_symbol_impl<CharT>(out, u.reference_unit, fmt, negative_power);
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user