mirror of
https://github.com/mpusz/mp-units.git
synced 2025-06-25 01:01:33 +02:00
fix: mag_constant
workarounds branches for clang fixed
This commit is contained in:
@ -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
|
||||
|
@ -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>
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user