boostorg / boostorg/date_time

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

Open
#237 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
70
Forks
99
PR merge metrics
No merged PRs in 30d

Description

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"](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rconst-constexpr) 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 `constexpr`essivity, but it would be nice if these warnings disappeared.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.