mirror of
https://github.com/mpusz/mp-units.git
synced 2025-07-29 18:07:16 +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
|
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>
|
template<symbol_text Symbol>
|
||||||
struct mag_constant {
|
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.
|
* @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"}> {
|
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>;
|
static constexpr auto _value_ = std::numbers::pi_v<long double>;
|
||||||
#else
|
#else
|
||||||
|
@ -38,7 +38,7 @@ import std;
|
|||||||
|
|
||||||
namespace mp_units {
|
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>
|
MP_UNITS_EXPORT template<symbol_text Symbol>
|
||||||
#else
|
#else
|
||||||
MP_UNITS_EXPORT template<symbol_text Symbol, long double Value>
|
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)");
|
// static_assert(unit_symbol<usf{.char_set = portable}>(mag<1> / mag_power<2, 1, 2> * m) == "(1/2^(1/2) m)");
|
||||||
|
|
||||||
// magnitude constants
|
// 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"> {
|
inline constexpr struct e final : mag_constant<"e"> {
|
||||||
static constexpr long double _value_ = std::numbers::e_v<long double>;
|
static constexpr long double _value_ = std::numbers::e_v<long double>;
|
||||||
#else
|
#else
|
||||||
|
Reference in New Issue
Block a user