constexpr instead const

This commit is contained in:
vaclavt
2022-02-28 19:48:27 +01:00
parent 2b3d8ab026
commit b845cf756c

View File

@@ -33,7 +33,7 @@ std::string date_to_string(const long datetime, const std::string& format) {
} }
time_t time_to_epoch ( const struct tm *ltm, int utcdiff ) { time_t time_to_epoch ( const struct tm *ltm, int utcdiff ) {
const int mon_days [] = {0, 31, 31+28, 31+28+31, constexpr int mon_days [] = {0, 31, 31+28, 31+28+31,
31+28+31+30, 31+28+31+30+31, 31+28+31+30+31+30, 31+28+31+30, 31+28+31+30+31, 31+28+31+30+31+30,
31+28+31+30+31+30+31, 31+28+31+30+31+30+31+31, 31+28+31+30+31+30+31+31+30, 31+28+31+30+31+30+31, 31+28+31+30+31+30+31+31, 31+28+31+30+31+30+31+31+30,
31+28+31+30+31+30+31+31+30+31, 31+28+31+30+31+30+31+31+30+31+30, 31+28+31+30+31+30+31+31+30+31+30+31}; 31+28+31+30+31+30+31+31+30+31, 31+28+31+30+31+30+31+31+30+31+30, 31+28+31+30+31+30+31+31+30+31+30+31};