units icon indicating copy to clipboard operation
units copied to clipboard

expression did not evaluate to a constant

Open StrikeByte opened this issue 7 months ago • 4 comments

The initialization of the time constants can lead to the following error when using msvc2019 "expression did not evaluate to a constant" when parentheses are replaced with curly brackets the problem does not occur

unit_definitions.hpp namespace time { constexpr precise_unit min{60.0, s}; //this fixes the problem for me constexpr precise_unit ms{0.001, s}; constexpr precise_unit ns{1e-9, s}; constexpr precise_unit hr{60.0, min}; constexpr precise_unit h{60.0, min}; constexpr precise_unit day{24.0, hr}; constexpr precise_unit week{7.0, day}; constexpr precise_unit yr{8760.0, hr}; // median calendar year; constexpr precise_unit fortnight{14, day}; ...

StrikeByte avatar Nov 15 '23 12:11 StrikeByte