fix(clock): remove literal operator with reserved name
``` ../include/util/date.hpp:34:26: warning: literal operator suffixes not preceded by ‘_’ are reserved for future standardization [-Wliteral-suffix] 34 | constexpr decltype(auto) operator""d(unsigned long long d) noexcept { ```pull/2940/head
parent
a2deff3689
commit
f885baba61
|
@ -30,10 +30,6 @@ template <typename T>
|
||||||
inline auto format(const std::locale& loc, const char* spec, const T& arg) {
|
inline auto format(const std::locale& loc, const char* spec, const T& arg) {
|
||||||
return date::format(loc, std::regex_replace(spec, std::regex("\\{:L|\\}"), ""), arg);
|
return date::format(loc, std::regex_replace(spec, std::regex("\\{:L|\\}"), ""), arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr decltype(auto) operator""d(unsigned long long d) noexcept {
|
|
||||||
return date::operator""_d(d); // very verbose, but it works
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
} // namespace date
|
} // namespace date
|
||||||
|
|
||||||
|
|
|
@ -221,22 +221,22 @@ auto getCalendarLine(const year_month_day& currDate, const year_month ym, const
|
||||||
}
|
}
|
||||||
// Print first week prefixed with spaces if necessary
|
// Print first week prefixed with spaces if necessary
|
||||||
case 2: {
|
case 2: {
|
||||||
|
auto d{day{1}};
|
||||||
auto wd{weekday{ym / 1}};
|
auto wd{weekday{ym / 1}};
|
||||||
os << std::string((wd - firstdow).count() * 3, ' ');
|
os << std::string((wd - firstdow).count() * 3, ' ');
|
||||||
|
|
||||||
if (currDate != ym / 1d)
|
|
||||||
os << date::format(*locale_, "{:L%e}", 1d);
|
|
||||||
else
|
|
||||||
os << "{today}";
|
|
||||||
|
|
||||||
auto d{2d};
|
|
||||||
while (++wd != firstdow) {
|
|
||||||
if (currDate != ym / d)
|
if (currDate != ym / d)
|
||||||
os << date::format(*locale_, "{:L%e}", d);
|
os << date::format(*locale_, "{:L%e}", d);
|
||||||
else
|
else
|
||||||
os << "{today}";
|
os << "{today}";
|
||||||
|
|
||||||
|
while (++wd != firstdow) {
|
||||||
++d;
|
++d;
|
||||||
|
|
||||||
|
if (currDate != ym / d)
|
||||||
|
os << date::format(*locale_, " {:L%e}", d);
|
||||||
|
else
|
||||||
|
os << " {today}";
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue