It was often required to define certain constants statically and preferably as constexpr, although there are certain times, values may need to be -ve. This is already possible with full declaration of the unit, although does not support alongside the literals. Please see example below:
static constexpr units::angle::radian_t kAngularValue{-30.0_deg}; /// ERROR: Compiler will not find `constexpr`
/// definition of the literal to convert deg to
/// radian implicitly for negative numbers.
static constexpr units::angle::radian_t kAngularValue = units::angle::degree_t{-30.0}; /// WORKS FINE
static constexpr units::angle::radian_t kAngularValue{30.0_deg}; /// WORKS FINE
It was often required to define certain constants statically and preferably as
constexpr
, although there are certain times, values may need to be-ve
. This is already possible with full declaration of the unit, although does not support alongside the literals. Please see example below:I request the FIX or SUPPORT for such use-case.
Thanks in advance.
Library Version: v2.3.1 Compiler Used: GCC v12, Clang v12