[PATCH] libstdc++: Add more C++20 additions to <chrono>
Tue Aug 25 13:56:26 GMT 2020
On 24/08/20 23:01 -0400, Patrick Palka via Libstdc++ wrote:
>This patch adds the C++20 calendar types and their methods as defined in
>[time.cal] (modulo the parsing/printing support). This patch also
>implements [time.hms] and [time.12], and a few more bits of
>[time.clock]. The remaining C++20 additions to <chrono> from P0355 and
>P1466 depend on [time.zone] and <format>, so they will come later, as
>will more optimized versions of some of the calendar algorithms.
>The non-member operator overloads for the calendar types are defined as
>namespace-scope functions in the standard, but here we instead define
>each such operator overload as a hidden friend of the appropriate class.
>This simplifies the implementation somewhat and lets us reap the
>benefits of hidden friends for these routines.
>The bulk of this work is based on a patch from Ed Smith-Rowland, which can
>be found at the Git branch users/redi/heads/calendar.
>Regression tested on x86_64-pc-linux-gnu, and also tested against the
>testsuite for date.h of Howard Hinnant's 'date' library, i.e. the tests
>(though some minor modifications to the tests are first needed to
>account for the differences between the library API and the standard).
Looks good, please push (with the testsuite date fix mentioned on
More information about the Libstdc++