4 ms·
Some parts of C++20 are really good, like most of what is stated in the article. But C++ would not be C++ if it had no shenanigans coming. Unless they have cha
by sharpneli 7y ago
Some parts of C++20 are really good, like most of what is stated in the article.
But C++ would not be C++ if it had no shenanigans coming. Unless they have changed things within some months the new calendar/datetime library is hilarious.
It has features like being able to write a date like: 1/2/2000y. ooh fancy operatoe overloading. Which one is month? The first one ofcourse as it they didn’t standardize on any of the existing ISO standards, or allow you to choose, but selected ”Customary US way” as the Only True C++ Way(tm).
Also do not forget the abuse of operator overloading like in the good 90’s when misusing it was the recommended thing.
- vbezhenar 7y agoWhy not something like Date.of(2000, 2, 1)? Much more sane. Or Date.ofYear(2000).month(2).day(1) for more descriptive usage.
- alexhutcheson 7y agoFWIW the absl CivilTime library is excellent: https://abseil.io/blog/20181010-civil-time https://abseil.io/blog/20181010-civil-time
- gpderetta 7y agoAs far as I can tell from cppreference (I literally found out about the datetime extension to chrono right now), your example won't come mobile because it is ambiguous.