boostorg / date_time

Boost.org date_time module
http://boost.org/libs/date_time
Boost Software License 1.0
67 stars 95 forks source link

Core guideline: Use constexpr for values that can be computed at compile time #237

Open trueqbit opened 11 months ago

trueqbit commented 11 months ago

Commit 4e1b7cde45ed introduced constexpr functions.

A code analysis with Visual C++ 2022 and the Microsoft Recommended Native Recommended Rules spits out the warning "con.5" from the category "Constants and immutability" in str_from_delimited_time_duration() and counted_time_rep<>::frac_sec_per_day():

warning C26498: The function 'function' is constexpr, mark variable 'variable' constexpr if compile-time evaluation is desired (con.5).

Correcting this warning has no effect on the constexpressivity, but it would be nice if these warnings disappeared.