fix: mag_constant workarounds branches for clang fixed

This commit is contained in:
Mateusz Pusz
2025-04-03 08:06:13 +01:00
parent 8cf0f4791e
commit ee02ed4fd1
3 changed files with 4 additions and 4 deletions

View File

@ -42,7 +42,7 @@ namespace mp_units {
MP_UNITS_EXPORT_BEGIN
#if defined MP_UNITS_COMP_CLANG || MP_UNITS_COMP_CLANG < 18
#if defined MP_UNITS_COMP_CLANG && MP_UNITS_COMP_CLANG < 18
template<symbol_text Symbol>
struct mag_constant {
@ -86,7 +86,7 @@ constexpr UnitMagnitude auto mag_power = pow<Num, Den>(mag<Base>);
/**
* @brief A convenient Magnitude constant for pi, which we can manipulate like a regular number.
*/
#if defined MP_UNITS_COMP_CLANG || MP_UNITS_COMP_CLANG < 18
#if defined MP_UNITS_COMP_CLANG && MP_UNITS_COMP_CLANG < 18
inline constexpr struct pi final : mag_constant<symbol_text{u8"π" /* U+03C0 GREEK SMALL LETTER PI */, "pi"}> {
static constexpr auto _value_ = std::numbers::pi_v<long double>;
#else

View File

@ -38,7 +38,7 @@ import std;
namespace mp_units {
#if defined MP_UNITS_COMP_CLANG || MP_UNITS_COMP_CLANG < 18
#if defined MP_UNITS_COMP_CLANG && MP_UNITS_COMP_CLANG < 18
MP_UNITS_EXPORT template<symbol_text Symbol>
#else
MP_UNITS_EXPORT template<symbol_text Symbol, long double Value>

View File

@ -142,7 +142,7 @@ static_assert(unit_symbol<usf{.char_set = portable}>(mag_ratio<1, 18000> * (metr
// static_assert(unit_symbol<usf{.char_set = portable}>(mag<1> / mag_power<2, 1, 2> * m) == "(1/2^(1/2) m)");
// magnitude constants
#if defined MP_UNITS_COMP_CLANG || MP_UNITS_COMP_CLANG < 18
#if defined MP_UNITS_COMP_CLANG && MP_UNITS_COMP_CLANG < 18
inline constexpr struct e final : mag_constant<"e"> {
static constexpr long double _value_ = std::numbers::e_v<long double>;
#else