xref: /llvm-project-15.0.7/libcxx/include/chrono (revision fd36a3d4)
13e519524SHoward Hinnant// -*- C++ -*-
2eb8650a7SLouis Dionne//===----------------------------------------------------------------------===//
33e519524SHoward Hinnant//
457b08b09SChandler Carruth// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
557b08b09SChandler Carruth// See https://llvm.org/LICENSE.txt for license information.
657b08b09SChandler Carruth// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
73e519524SHoward Hinnant//
83e519524SHoward Hinnant//===----------------------------------------------------------------------===//
93e519524SHoward Hinnant
103e519524SHoward Hinnant#ifndef _LIBCPP_CHRONO
113e519524SHoward Hinnant#define _LIBCPP_CHRONO
123e519524SHoward Hinnant
133e519524SHoward Hinnant/*
143e519524SHoward Hinnant    chrono synopsis
153e519524SHoward Hinnant
16*fd36a3d4SMark de Wever#include <compare> // C++20
17*fd36a3d4SMark de Wever
183e519524SHoward Hinnantnamespace std
193e519524SHoward Hinnant{
203e519524SHoward Hinnantnamespace chrono
213e519524SHoward Hinnant{
223e519524SHoward Hinnant
233e519524SHoward Hinnanttemplate <class ToDuration, class Rep, class Period>
24c0331153SHoward Hinnantconstexpr
253e519524SHoward HinnantToDuration
263e519524SHoward Hinnantduration_cast(const duration<Rep, Period>& fd);
273e519524SHoward Hinnant
283e519524SHoward Hinnanttemplate <class Rep> struct treat_as_floating_point : is_floating_point<Rep> {};
293e519524SHoward Hinnant
3040a01d53SMarshall Clowtemplate <class Rep> inline constexpr bool treat_as_floating_point_v
31b8427293SMarshall Clow    = treat_as_floating_point<Rep>::value;                       // C++17
32b8427293SMarshall Clow
333e519524SHoward Hinnanttemplate <class Rep>
343e519524SHoward Hinnantstruct duration_values
353e519524SHoward Hinnant{
363e519524SHoward Hinnantpublic:
37cf355fc3SMarshall Clow    static constexpr Rep zero(); // noexcept in C++20
38cf355fc3SMarshall Clow    static constexpr Rep max();  // noexcept in C++20
39cf355fc3SMarshall Clow    static constexpr Rep min();  // noexcept in C++20
403e519524SHoward Hinnant};
413e519524SHoward Hinnant
423e519524SHoward Hinnant// duration
433e519524SHoward Hinnant
443e519524SHoward Hinnanttemplate <class Rep, class Period = ratio<1>>
453e519524SHoward Hinnantclass duration
463e519524SHoward Hinnant{
473e519524SHoward Hinnant    static_assert(!__is_duration<Rep>::value, "A duration representation can not be a duration");
483e519524SHoward Hinnant    static_assert(__is_ratio<Period>::value, "Second template parameter of duration must be a std::ratio");
493e519524SHoward Hinnant    static_assert(Period::num > 0, "duration period must be positive");
503e519524SHoward Hinnantpublic:
513e519524SHoward Hinnant    typedef Rep rep;
529bd9ed4dSMarshall Clow    typedef typename _Period::type period;
533e519524SHoward Hinnant
54c0331153SHoward Hinnant    constexpr duration() = default;
553e519524SHoward Hinnant    template <class Rep2>
56c0331153SHoward Hinnant        constexpr explicit duration(const Rep2& r,
573e519524SHoward Hinnant            typename enable_if
583e519524SHoward Hinnant            <
593e519524SHoward Hinnant               is_convertible<Rep2, rep>::value &&
603e519524SHoward Hinnant               (treat_as_floating_point<rep>::value ||
613e519524SHoward Hinnant               !treat_as_floating_point<rep>::value && !treat_as_floating_point<Rep2>::value)
623e519524SHoward Hinnant            >::type* = 0);
633e519524SHoward Hinnant
643e519524SHoward Hinnant    // conversions
653e519524SHoward Hinnant    template <class Rep2, class Period2>
66c0331153SHoward Hinnant        constexpr duration(const duration<Rep2, Period2>& d,
673e519524SHoward Hinnant            typename enable_if
683e519524SHoward Hinnant            <
693e519524SHoward Hinnant                treat_as_floating_point<rep>::value ||
703e519524SHoward Hinnant                ratio_divide<Period2, period>::type::den == 1
713e519524SHoward Hinnant            >::type* = 0);
723e519524SHoward Hinnant
733e519524SHoward Hinnant    // observer
743e519524SHoward Hinnant
75c0331153SHoward Hinnant    constexpr rep count() const;
763e519524SHoward Hinnant
773e519524SHoward Hinnant    // arithmetic
783e519524SHoward Hinnant
799bd9ed4dSMarshall Clow    constexpr common_type<duration>::type  operator+() const;
809bd9ed4dSMarshall Clow    constexpr common_type<duration>::type  operator-() const;
81d0ab67f7SMarshall Clow    constexpr duration& operator++();    // constexpr in C++17
82d0ab67f7SMarshall Clow    constexpr duration  operator++(int); // constexpr in C++17
83d0ab67f7SMarshall Clow    constexpr duration& operator--();    // constexpr in C++17
84d0ab67f7SMarshall Clow    constexpr duration  operator--(int); // constexpr in C++17
853e519524SHoward Hinnant
86d0ab67f7SMarshall Clow    constexpr duration& operator+=(const duration& d);  // constexpr in C++17
87d0ab67f7SMarshall Clow    constexpr duration& operator-=(const duration& d);  // constexpr in C++17
883e519524SHoward Hinnant
89d0ab67f7SMarshall Clow    duration& operator*=(const rep& rhs);       // constexpr in C++17
90d0ab67f7SMarshall Clow    duration& operator/=(const rep& rhs);       // constexpr in C++17
91d0ab67f7SMarshall Clow    duration& operator%=(const rep& rhs);       // constexpr in C++17
92d0ab67f7SMarshall Clow    duration& operator%=(const duration& rhs);  // constexpr in C++17
933e519524SHoward Hinnant
943e519524SHoward Hinnant    // special values
953e519524SHoward Hinnant
96cf355fc3SMarshall Clow    static constexpr duration zero(); // noexcept in C++20
97cf355fc3SMarshall Clow    static constexpr duration min();  // noexcept in C++20
98cf355fc3SMarshall Clow    static constexpr duration max();  // noexcept in C++20
993e519524SHoward Hinnant};
1003e519524SHoward Hinnant
1013e519524SHoward Hinnanttypedef duration<long long,         nano> nanoseconds;
1023e519524SHoward Hinnanttypedef duration<long long,        micro> microseconds;
1033e519524SHoward Hinnanttypedef duration<long long,        milli> milliseconds;
1043e519524SHoward Hinnanttypedef duration<long long              > seconds;
1053e519524SHoward Hinnanttypedef duration<     long, ratio<  60> > minutes;
1063e519524SHoward Hinnanttypedef duration<     long, ratio<3600> > hours;
1073e519524SHoward Hinnant
1083e519524SHoward Hinnanttemplate <class Clock, class Duration = typename Clock::duration>
1093e519524SHoward Hinnantclass time_point
1103e519524SHoward Hinnant{
1113e519524SHoward Hinnantpublic:
1123e519524SHoward Hinnant    typedef Clock                     clock;
1133e519524SHoward Hinnant    typedef Duration                  duration;
1143e519524SHoward Hinnant    typedef typename duration::rep    rep;
1153e519524SHoward Hinnant    typedef typename duration::period period;
1163e519524SHoward Hinnantprivate:
1173e519524SHoward Hinnant    duration d_;  // exposition only
1183e519524SHoward Hinnant
1193e519524SHoward Hinnantpublic:
120a1d0d376SMarshall Clow    time_point();  // has value "epoch" // constexpr in C++14
121a1d0d376SMarshall Clow    explicit time_point(const duration& d);  // same as time_point() + d // constexpr in C++14
1223e519524SHoward Hinnant
1233e519524SHoward Hinnant    // conversions
1243e519524SHoward Hinnant    template <class Duration2>
125a1d0d376SMarshall Clow       time_point(const time_point<clock, Duration2>& t); // constexpr in C++14
1263e519524SHoward Hinnant
1273e519524SHoward Hinnant    // observer
1283e519524SHoward Hinnant
129a1d0d376SMarshall Clow    duration time_since_epoch() const; // constexpr in C++14
1303e519524SHoward Hinnant
1313e519524SHoward Hinnant    // arithmetic
1323e519524SHoward Hinnant
133d0ab67f7SMarshall Clow    time_point& operator+=(const duration& d); // constexpr in C++17
134d0ab67f7SMarshall Clow    time_point& operator-=(const duration& d); // constexpr in C++17
1353e519524SHoward Hinnant
1363e519524SHoward Hinnant    // special values
1373e519524SHoward Hinnant
138cf355fc3SMarshall Clow    static constexpr time_point min();  // noexcept in C++20
139cf355fc3SMarshall Clow    static constexpr time_point max();  // noexcept in C++20
1403e519524SHoward Hinnant};
1413e519524SHoward Hinnant
1423e519524SHoward Hinnant} // chrono
1433e519524SHoward Hinnant
1443e519524SHoward Hinnant// common_type traits
1453e519524SHoward Hinnanttemplate <class Rep1, class Period1, class Rep2, class Period2>
1463e519524SHoward Hinnant  struct common_type<chrono::duration<Rep1, Period1>, chrono::duration<Rep2, Period2>>;
1473e519524SHoward Hinnant
1483e519524SHoward Hinnanttemplate <class Clock, class Duration1, class Duration2>
1493e519524SHoward Hinnant  struct common_type<chrono::time_point<Clock, Duration1>, chrono::time_point<Clock, Duration2>>;
1503e519524SHoward Hinnant
1513e519524SHoward Hinnantnamespace chrono {
1523e519524SHoward Hinnant
1533e519524SHoward Hinnant// duration arithmetic
1543e519524SHoward Hinnanttemplate <class Rep1, class Period1, class Rep2, class Period2>
155c0331153SHoward Hinnant  constexpr
1563e519524SHoward Hinnant  typename common_type<duration<Rep1, Period1>, duration<Rep2, Period2>>::type
1573e519524SHoward Hinnant  operator+(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
1583e519524SHoward Hinnanttemplate <class Rep1, class Period1, class Rep2, class Period2>
159c0331153SHoward Hinnant  constexpr
1603e519524SHoward Hinnant  typename common_type<duration<Rep1, Period1>, duration<Rep2, Period2>>::type
1613e519524SHoward Hinnant  operator-(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
1623e519524SHoward Hinnanttemplate <class Rep1, class Period, class Rep2>
163c0331153SHoward Hinnant  constexpr
1643e519524SHoward Hinnant  duration<typename common_type<Rep1, Rep2>::type, Period>
1653e519524SHoward Hinnant  operator*(const duration<Rep1, Period>& d, const Rep2& s);
1663e519524SHoward Hinnanttemplate <class Rep1, class Period, class Rep2>
167c0331153SHoward Hinnant  constexpr
1683e519524SHoward Hinnant  duration<typename common_type<Rep1, Rep2>::type, Period>
1693e519524SHoward Hinnant  operator*(const Rep1& s, const duration<Rep2, Period>& d);
1703e519524SHoward Hinnanttemplate <class Rep1, class Period, class Rep2>
171c0331153SHoward Hinnant  constexpr
1723e519524SHoward Hinnant  duration<typename common_type<Rep1, Rep2>::type, Period>
1733e519524SHoward Hinnant  operator/(const duration<Rep1, Period>& d, const Rep2& s);
1743e519524SHoward Hinnanttemplate <class Rep1, class Period1, class Rep2, class Period2>
175c0331153SHoward Hinnant  constexpr
1763e519524SHoward Hinnant  typename common_type<Rep1, Rep2>::type
1773e519524SHoward Hinnant  operator/(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
1783e519524SHoward Hinnant
1793e519524SHoward Hinnant// duration comparisons
1803e519524SHoward Hinnanttemplate <class Rep1, class Period1, class Rep2, class Period2>
181c0331153SHoward Hinnant   constexpr
1823e519524SHoward Hinnant   bool operator==(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
1833e519524SHoward Hinnanttemplate <class Rep1, class Period1, class Rep2, class Period2>
184c0331153SHoward Hinnant   constexpr
1853e519524SHoward Hinnant   bool operator!=(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
1863e519524SHoward Hinnanttemplate <class Rep1, class Period1, class Rep2, class Period2>
187c0331153SHoward Hinnant   constexpr
1883e519524SHoward Hinnant   bool operator< (const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
1893e519524SHoward Hinnanttemplate <class Rep1, class Period1, class Rep2, class Period2>
190c0331153SHoward Hinnant   constexpr
1913e519524SHoward Hinnant   bool operator<=(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
1923e519524SHoward Hinnanttemplate <class Rep1, class Period1, class Rep2, class Period2>
193c0331153SHoward Hinnant   constexpr
1943e519524SHoward Hinnant   bool operator> (const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
1953e519524SHoward Hinnanttemplate <class Rep1, class Period1, class Rep2, class Period2>
196c0331153SHoward Hinnant   constexpr
1973e519524SHoward Hinnant   bool operator>=(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
1983e519524SHoward Hinnant
1993e519524SHoward Hinnant// duration_cast
2003e519524SHoward Hinnanttemplate <class ToDuration, class Rep, class Period>
2013e519524SHoward Hinnant  ToDuration duration_cast(const duration<Rep, Period>& d);
2023e519524SHoward Hinnant
2032cd0d6d6SMarshall Clowtemplate <class ToDuration, class Rep, class Period>
2042cd0d6d6SMarshall Clow    constexpr ToDuration floor(const duration<Rep, Period>& d);    // C++17
2052cd0d6d6SMarshall Clowtemplate <class ToDuration, class Rep, class Period>
2062cd0d6d6SMarshall Clow    constexpr ToDuration ceil(const duration<Rep, Period>& d);     // C++17
2072cd0d6d6SMarshall Clowtemplate <class ToDuration, class Rep, class Period>
2082cd0d6d6SMarshall Clow    constexpr ToDuration round(const duration<Rep, Period>& d);    // C++17
2092cd0d6d6SMarshall Clow
210da77fe4aSMarshall Clow// duration I/O is elsewhere
211da77fe4aSMarshall Clow
212a1d0d376SMarshall Clow// time_point arithmetic (all constexpr in C++14)
2133e519524SHoward Hinnanttemplate <class Clock, class Duration1, class Rep2, class Period2>
2143e519524SHoward Hinnant  time_point<Clock, typename common_type<Duration1, duration<Rep2, Period2>>::type>
2153e519524SHoward Hinnant  operator+(const time_point<Clock, Duration1>& lhs, const duration<Rep2, Period2>& rhs);
2163e519524SHoward Hinnanttemplate <class Rep1, class Period1, class Clock, class Duration2>
2173e519524SHoward Hinnant  time_point<Clock, typename common_type<duration<Rep1, Period1>, Duration2>::type>
2183e519524SHoward Hinnant  operator+(const duration<Rep1, Period1>& lhs, const time_point<Clock, Duration2>& rhs);
2193e519524SHoward Hinnanttemplate <class Clock, class Duration1, class Rep2, class Period2>
2203e519524SHoward Hinnant  time_point<Clock, typename common_type<Duration1, duration<Rep2, Period2>>::type>
2213e519524SHoward Hinnant  operator-(const time_point<Clock, Duration1>& lhs, const duration<Rep2, Period2>& rhs);
2223e519524SHoward Hinnanttemplate <class Clock, class Duration1, class Duration2>
2233e519524SHoward Hinnant  typename common_type<Duration1, Duration2>::type
2243e519524SHoward Hinnant  operator-(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
2253e519524SHoward Hinnant
226a1d0d376SMarshall Clow// time_point comparisons (all constexpr in C++14)
2273e519524SHoward Hinnanttemplate <class Clock, class Duration1, class Duration2>
2283e519524SHoward Hinnant   bool operator==(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
2293e519524SHoward Hinnanttemplate <class Clock, class Duration1, class Duration2>
2303e519524SHoward Hinnant   bool operator!=(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
2313e519524SHoward Hinnanttemplate <class Clock, class Duration1, class Duration2>
2323e519524SHoward Hinnant   bool operator< (const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
2333e519524SHoward Hinnanttemplate <class Clock, class Duration1, class Duration2>
2343e519524SHoward Hinnant   bool operator<=(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
2353e519524SHoward Hinnanttemplate <class Clock, class Duration1, class Duration2>
2363e519524SHoward Hinnant   bool operator> (const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
2373e519524SHoward Hinnanttemplate <class Clock, class Duration1, class Duration2>
2383e519524SHoward Hinnant   bool operator>=(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
2393e519524SHoward Hinnant
240a1d0d376SMarshall Clow// time_point_cast (constexpr in C++14)
2413e519524SHoward Hinnant
2423e519524SHoward Hinnanttemplate <class ToDuration, class Clock, class Duration>
2433e519524SHoward Hinnant  time_point<Clock, ToDuration> time_point_cast(const time_point<Clock, Duration>& t);
2443e519524SHoward Hinnant
2452cd0d6d6SMarshall Clowtemplate <class ToDuration, class Clock, class Duration>
2462cd0d6d6SMarshall Clow    constexpr time_point<Clock, ToDuration>
2472cd0d6d6SMarshall Clow    floor(const time_point<Clock, Duration>& tp);                  // C++17
2482cd0d6d6SMarshall Clow
2492cd0d6d6SMarshall Clowtemplate <class ToDuration, class Clock, class Duration>
2502cd0d6d6SMarshall Clow    constexpr time_point<Clock, ToDuration>
2512cd0d6d6SMarshall Clow    ceil(const time_point<Clock, Duration>& tp);                   // C++17
2522cd0d6d6SMarshall Clow
2532cd0d6d6SMarshall Clowtemplate <class ToDuration, class Clock, class Duration>
2542cd0d6d6SMarshall Clow    constexpr time_point<Clock, ToDuration>
2552cd0d6d6SMarshall Clow    round(const time_point<Clock, Duration>& tp);                  // C++17
2562cd0d6d6SMarshall Clow
2572cd0d6d6SMarshall Clowtemplate <class Rep, class Period>
2582cd0d6d6SMarshall Clow    constexpr duration<Rep, Period> abs(duration<Rep, Period> d);  // C++17
259da77fe4aSMarshall Clow
2603e519524SHoward Hinnant// Clocks
2613e519524SHoward Hinnant
2623e519524SHoward Hinnantclass system_clock
2633e519524SHoward Hinnant{
2643e519524SHoward Hinnantpublic:
2653e519524SHoward Hinnant    typedef microseconds                     duration;
2663e519524SHoward Hinnant    typedef duration::rep                    rep;
2673e519524SHoward Hinnant    typedef duration::period                 period;
2683e519524SHoward Hinnant    typedef chrono::time_point<system_clock> time_point;
269a1d0d376SMarshall Clow    static const bool is_steady =            false; // constexpr in C++14
2703e519524SHoward Hinnant
271d53d8152SHoward Hinnant    static time_point now() noexcept;
272d53d8152SHoward Hinnant    static time_t     to_time_t  (const time_point& __t) noexcept;
273d53d8152SHoward Hinnant    static time_point from_time_t(time_t __t) noexcept;
2743e519524SHoward Hinnant};
2753e519524SHoward Hinnant
276da77fe4aSMarshall Clowtemplate <class Duration>
277da77fe4aSMarshall Clow  using sys_time  = time_point<system_clock, Duration>; // C++20
278da77fe4aSMarshall Clowusing sys_seconds = sys_time<seconds>;                  // C++20
279da77fe4aSMarshall Clowusing sys_days    = sys_time<days>;                     // C++20
280da77fe4aSMarshall Clow
281dce5fc56SLouis Dionneclass file_clock                                        // C++20
282dce5fc56SLouis Dionne{
283dce5fc56SLouis Dionnepublic:
284dce5fc56SLouis Dionne    typedef see-below                      rep;
285dce5fc56SLouis Dionne    typedef nano                           period;
286dce5fc56SLouis Dionne    typedef chrono::duration<rep, period>  duration;
287dce5fc56SLouis Dionne    typedef chrono::time_point<file_clock> time_point;
288dce5fc56SLouis Dionne    static constexpr bool is_steady =      false;
289dce5fc56SLouis Dionne
290dce5fc56SLouis Dionne    static time_point now() noexcept;
291dce5fc56SLouis Dionne
292dce5fc56SLouis Dionne    template<class Duration>
293dce5fc56SLouis Dionne    static sys_time<see-below> to_sys(const file_time<Duration>&);
294dce5fc56SLouis Dionne
295dce5fc56SLouis Dionne    template<class Duration>
296dce5fc56SLouis Dionne    static file_time<see-below> from_sys(const sys_time<Duration>&);
297dce5fc56SLouis Dionne};
298da77fe4aSMarshall Clow
299da77fe4aSMarshall Clowtemplate<class Duration>
300da77fe4aSMarshall Clow  using file_time = time_point<file_clock, Duration>;   // C++20
301da77fe4aSMarshall Clow
3023dc6455fSHoward Hinnantclass steady_clock
3033e519524SHoward Hinnant{
3043e519524SHoward Hinnantpublic:
3053e519524SHoward Hinnant    typedef nanoseconds                                   duration;
3063e519524SHoward Hinnant    typedef duration::rep                                 rep;
3073e519524SHoward Hinnant    typedef duration::period                              period;
3083dc6455fSHoward Hinnant    typedef chrono::time_point<steady_clock, duration>    time_point;
309a1d0d376SMarshall Clow    static const bool is_steady =                         true; // constexpr in C++14
3103e519524SHoward Hinnant
311d53d8152SHoward Hinnant    static time_point now() noexcept;
3123e519524SHoward Hinnant};
3133e519524SHoward Hinnant
3143dc6455fSHoward Hinnanttypedef steady_clock high_resolution_clock;
3153e519524SHoward Hinnant
316da77fe4aSMarshall Clow// 25.7.8, local time           // C++20
317da77fe4aSMarshall Clowstruct local_t {};
318da77fe4aSMarshall Clowtemplate<class Duration>
319da77fe4aSMarshall Clow  using local_time  = time_point<local_t, Duration>;
320da77fe4aSMarshall Clowusing local_seconds = local_time<seconds>;
321da77fe4aSMarshall Clowusing local_days    = local_time<days>;
322da77fe4aSMarshall Clow
323da77fe4aSMarshall Clow// 25.8.2, class last_spec    // C++20
324da77fe4aSMarshall Clowstruct last_spec;
325da77fe4aSMarshall Clow
326da77fe4aSMarshall Clow// 25.8.3, class day          // C++20
327da77fe4aSMarshall Clow
328da77fe4aSMarshall Clowclass day;
329da77fe4aSMarshall Clowconstexpr bool operator==(const day& x, const day& y) noexcept;
330*fd36a3d4SMark de Weverconstexpr strong_ordering operator<=>(const day& x, const day& y) noexcept;
331da77fe4aSMarshall Clowconstexpr day  operator+(const day&  x, const days& y) noexcept;
332da77fe4aSMarshall Clowconstexpr day  operator+(const days& x, const day&  y) noexcept;
333da77fe4aSMarshall Clowconstexpr day  operator-(const day&  x, const days& y) noexcept;
334da77fe4aSMarshall Clowconstexpr days operator-(const day&  x, const day&  y) noexcept;
335da77fe4aSMarshall Clow
336da77fe4aSMarshall Clow// 25.8.4, class month    // C++20
337da77fe4aSMarshall Clowclass month;
338da77fe4aSMarshall Clowconstexpr bool operator==(const month& x, const month& y) noexcept;
339da77fe4aSMarshall Clowconstexpr bool operator!=(const month& x, const month& y) noexcept;
340da77fe4aSMarshall Clowconstexpr bool operator< (const month& x, const month& y) noexcept;
341da77fe4aSMarshall Clowconstexpr bool operator> (const month& x, const month& y) noexcept;
342da77fe4aSMarshall Clowconstexpr bool operator<=(const month& x, const month& y) noexcept;
343da77fe4aSMarshall Clowconstexpr bool operator>=(const month& x, const month& y) noexcept;
344da77fe4aSMarshall Clowconstexpr month  operator+(const month&  x, const months& y) noexcept;
345da77fe4aSMarshall Clowconstexpr month  operator+(const months& x,  const month& y) noexcept;
346da77fe4aSMarshall Clowconstexpr month  operator-(const month&  x, const months& y) noexcept;
347da77fe4aSMarshall Clowconstexpr months operator-(const month&  x,  const month& y) noexcept;
348da77fe4aSMarshall Clow
349da77fe4aSMarshall Clow// 25.8.5, class year    // C++20
350da77fe4aSMarshall Clowclass year;
351da77fe4aSMarshall Clowconstexpr bool operator==(const year& x, const year& y) noexcept;
352da77fe4aSMarshall Clowconstexpr bool operator!=(const year& x, const year& y) noexcept;
353da77fe4aSMarshall Clowconstexpr bool operator< (const year& x, const year& y) noexcept;
354da77fe4aSMarshall Clowconstexpr bool operator> (const year& x, const year& y) noexcept;
355da77fe4aSMarshall Clowconstexpr bool operator<=(const year& x, const year& y) noexcept;
356da77fe4aSMarshall Clowconstexpr bool operator>=(const year& x, const year& y) noexcept;
357da77fe4aSMarshall Clowconstexpr year  operator+(const year&  x, const years& y) noexcept;
358da77fe4aSMarshall Clowconstexpr year  operator+(const years& x, const year&  y) noexcept;
359da77fe4aSMarshall Clowconstexpr year  operator-(const year&  x, const years& y) noexcept;
360da77fe4aSMarshall Clowconstexpr years operator-(const year&  x, const year&  y) noexcept;
361da77fe4aSMarshall Clow
362da77fe4aSMarshall Clow// 25.8.6, class weekday    // C++20
363da77fe4aSMarshall Clowclass weekday;
364da77fe4aSMarshall Clow
365da77fe4aSMarshall Clowconstexpr bool operator==(const weekday& x, const weekday& y) noexcept;
366da77fe4aSMarshall Clowconstexpr bool operator!=(const weekday& x, const weekday& y) noexcept;
367da77fe4aSMarshall Clowconstexpr weekday operator+(const weekday& x, const days&    y) noexcept;
368da77fe4aSMarshall Clowconstexpr weekday operator+(const days&    x, const weekday& y) noexcept;
369da77fe4aSMarshall Clowconstexpr weekday operator-(const weekday& x, const days&    y) noexcept;
370da77fe4aSMarshall Clowconstexpr days    operator-(const weekday& x, const weekday& y) noexcept;
371da77fe4aSMarshall Clow
372da77fe4aSMarshall Clow// 25.8.7, class weekday_indexed    // C++20
373da77fe4aSMarshall Clow
374da77fe4aSMarshall Clowclass weekday_indexed;
375da77fe4aSMarshall Clowconstexpr bool operator==(const weekday_indexed& x, const weekday_indexed& y) noexcept;
376da77fe4aSMarshall Clowconstexpr bool operator!=(const weekday_indexed& x, const weekday_indexed& y) noexcept;
377da77fe4aSMarshall Clow
378da77fe4aSMarshall Clow// 25.8.8, class weekday_last    // C++20
379da77fe4aSMarshall Clowclass weekday_last;
380da77fe4aSMarshall Clow
381da77fe4aSMarshall Clowconstexpr bool operator==(const weekday_last& x, const weekday_last& y) noexcept;
382da77fe4aSMarshall Clowconstexpr bool operator!=(const weekday_last& x, const weekday_last& y) noexcept;
383da77fe4aSMarshall Clow
384da77fe4aSMarshall Clow// 25.8.9, class month_day    // C++20
385da77fe4aSMarshall Clowclass month_day;
386da77fe4aSMarshall Clow
387da77fe4aSMarshall Clowconstexpr bool operator==(const month_day& x, const month_day& y) noexcept;
388da77fe4aSMarshall Clowconstexpr bool operator!=(const month_day& x, const month_day& y) noexcept;
389da77fe4aSMarshall Clowconstexpr bool operator< (const month_day& x, const month_day& y) noexcept;
390da77fe4aSMarshall Clowconstexpr bool operator> (const month_day& x, const month_day& y) noexcept;
391da77fe4aSMarshall Clowconstexpr bool operator<=(const month_day& x, const month_day& y) noexcept;
392da77fe4aSMarshall Clowconstexpr bool operator>=(const month_day& x, const month_day& y) noexcept;
393da77fe4aSMarshall Clow
394da77fe4aSMarshall Clow
395da77fe4aSMarshall Clow// 25.8.10, class month_day_last    // C++20
396da77fe4aSMarshall Clowclass month_day_last;
397da77fe4aSMarshall Clow
398da77fe4aSMarshall Clowconstexpr bool operator==(const month_day_last& x, const month_day_last& y) noexcept;
399da77fe4aSMarshall Clowconstexpr bool operator!=(const month_day_last& x, const month_day_last& y) noexcept;
400da77fe4aSMarshall Clowconstexpr bool operator< (const month_day_last& x, const month_day_last& y) noexcept;
401da77fe4aSMarshall Clowconstexpr bool operator> (const month_day_last& x, const month_day_last& y) noexcept;
402da77fe4aSMarshall Clowconstexpr bool operator<=(const month_day_last& x, const month_day_last& y) noexcept;
403da77fe4aSMarshall Clowconstexpr bool operator>=(const month_day_last& x, const month_day_last& y) noexcept;
404da77fe4aSMarshall Clow
405da77fe4aSMarshall Clow// 25.8.11, class month_weekday    // C++20
406da77fe4aSMarshall Clowclass month_weekday;
407da77fe4aSMarshall Clow
408da77fe4aSMarshall Clowconstexpr bool operator==(const month_weekday& x, const month_weekday& y) noexcept;
409da77fe4aSMarshall Clowconstexpr bool operator!=(const month_weekday& x, const month_weekday& y) noexcept;
410da77fe4aSMarshall Clow
411da77fe4aSMarshall Clow// 25.8.12, class month_weekday_last    // C++20
412da77fe4aSMarshall Clowclass month_weekday_last;
413da77fe4aSMarshall Clow
414da77fe4aSMarshall Clowconstexpr bool operator==(const month_weekday_last& x, const month_weekday_last& y) noexcept;
415da77fe4aSMarshall Clowconstexpr bool operator!=(const month_weekday_last& x, const month_weekday_last& y) noexcept;
416da77fe4aSMarshall Clow
417da77fe4aSMarshall Clow
418da77fe4aSMarshall Clow// 25.8.13, class year_month    // C++20
419da77fe4aSMarshall Clowclass year_month;
420da77fe4aSMarshall Clow
421da77fe4aSMarshall Clowconstexpr bool operator==(const year_month& x, const year_month& y) noexcept;
422da77fe4aSMarshall Clowconstexpr bool operator!=(const year_month& x, const year_month& y) noexcept;
423da77fe4aSMarshall Clowconstexpr bool operator< (const year_month& x, const year_month& y) noexcept;
424da77fe4aSMarshall Clowconstexpr bool operator> (const year_month& x, const year_month& y) noexcept;
425da77fe4aSMarshall Clowconstexpr bool operator<=(const year_month& x, const year_month& y) noexcept;
426da77fe4aSMarshall Clowconstexpr bool operator>=(const year_month& x, const year_month& y) noexcept;
427da77fe4aSMarshall Clow
428da77fe4aSMarshall Clowconstexpr year_month operator+(const year_month& ym, const months& dm) noexcept;
429da77fe4aSMarshall Clowconstexpr year_month operator+(const months& dm, const year_month& ym) noexcept;
430da77fe4aSMarshall Clowconstexpr year_month operator-(const year_month& ym, const months& dm) noexcept;
431da77fe4aSMarshall Clowconstexpr months operator-(const year_month& x, const year_month& y) noexcept;
432da77fe4aSMarshall Clowconstexpr year_month operator+(const year_month& ym, const years& dy) noexcept;
433da77fe4aSMarshall Clowconstexpr year_month operator+(const years& dy, const year_month& ym) noexcept;
434da77fe4aSMarshall Clowconstexpr year_month operator-(const year_month& ym, const years& dy) noexcept;
435da77fe4aSMarshall Clow
436da77fe4aSMarshall Clow// 25.8.14, class year_month_day class    // C++20
437da77fe4aSMarshall Clowyear_month_day;
438da77fe4aSMarshall Clow
439da77fe4aSMarshall Clowconstexpr bool operator==(const year_month_day& x, const year_month_day& y) noexcept;
440da77fe4aSMarshall Clowconstexpr bool operator!=(const year_month_day& x, const year_month_day& y) noexcept;
441da77fe4aSMarshall Clowconstexpr bool operator< (const year_month_day& x, const year_month_day& y) noexcept;
442da77fe4aSMarshall Clowconstexpr bool operator> (const year_month_day& x, const year_month_day& y) noexcept;
443da77fe4aSMarshall Clowconstexpr bool operator<=(const year_month_day& x, const year_month_day& y) noexcept;
444da77fe4aSMarshall Clowconstexpr bool operator>=(const year_month_day& x, const year_month_day& y) noexcept;
445da77fe4aSMarshall Clow
446da77fe4aSMarshall Clowconstexpr year_month_day operator+(const year_month_day& ymd, const months& dm) noexcept;
447da77fe4aSMarshall Clowconstexpr year_month_day operator+(const months& dm, const year_month_day& ymd) noexcept;
448da77fe4aSMarshall Clowconstexpr year_month_day operator+(const year_month_day& ymd, const years& dy) noexcept;
449da77fe4aSMarshall Clowconstexpr year_month_day operator+(const years& dy, const year_month_day& ymd) noexcept;
450da77fe4aSMarshall Clowconstexpr year_month_day operator-(const year_month_day& ymd, const months& dm) noexcept;
451da77fe4aSMarshall Clowconstexpr year_month_day operator-(const year_month_day& ymd, const years& dy) noexcept;
452da77fe4aSMarshall Clow
453da77fe4aSMarshall Clow
454da77fe4aSMarshall Clow// 25.8.15, class year_month_day_last    // C++20
455da77fe4aSMarshall Clowclass year_month_day_last;
456da77fe4aSMarshall Clow
457da77fe4aSMarshall Clowconstexpr bool operator==(const year_month_day_last& x,
458da77fe4aSMarshall Clow                          const year_month_day_last& y) noexcept;
459da77fe4aSMarshall Clowconstexpr bool operator!=(const year_month_day_last& x,
460da77fe4aSMarshall Clow                          const year_month_day_last& y) noexcept;
461da77fe4aSMarshall Clowconstexpr bool operator< (const year_month_day_last& x,
462da77fe4aSMarshall Clow                          const year_month_day_last& y) noexcept;
463da77fe4aSMarshall Clowconstexpr bool operator> (const year_month_day_last& x,
464da77fe4aSMarshall Clow                          const year_month_day_last& y) noexcept;
465da77fe4aSMarshall Clowconstexpr bool operator<=(const year_month_day_last& x,
466da77fe4aSMarshall Clow                          const year_month_day_last& y) noexcept;
467da77fe4aSMarshall Clowconstexpr bool operator>=(const year_month_day_last& x,
468da77fe4aSMarshall Clow                          const year_month_day_last& y) noexcept;
469da77fe4aSMarshall Clow
470da77fe4aSMarshall Clowconstexpr year_month_day_last
471da77fe4aSMarshall Clow  operator+(const year_month_day_last& ymdl, const months& dm) noexcept;
472da77fe4aSMarshall Clowconstexpr year_month_day_last
473da77fe4aSMarshall Clow  operator+(const months& dm, const year_month_day_last& ymdl) noexcept;
474da77fe4aSMarshall Clowconstexpr year_month_day_last
475da77fe4aSMarshall Clow  operator+(const year_month_day_last& ymdl, const years& dy) noexcept;
476da77fe4aSMarshall Clowconstexpr year_month_day_last
477da77fe4aSMarshall Clow  operator+(const years& dy, const year_month_day_last& ymdl) noexcept;
478da77fe4aSMarshall Clowconstexpr year_month_day_last
479da77fe4aSMarshall Clow  operator-(const year_month_day_last& ymdl, const months& dm) noexcept;
480da77fe4aSMarshall Clowconstexpr year_month_day_last
481da77fe4aSMarshall Clow  operator-(const year_month_day_last& ymdl, const years& dy) noexcept;
482da77fe4aSMarshall Clow
483da77fe4aSMarshall Clow// 25.8.16, class year_month_weekday    // C++20
484da77fe4aSMarshall Clowclass year_month_weekday;
485da77fe4aSMarshall Clow
486da77fe4aSMarshall Clowconstexpr bool operator==(const year_month_weekday& x,
487da77fe4aSMarshall Clow                          const year_month_weekday& y) noexcept;
488da77fe4aSMarshall Clowconstexpr bool operator!=(const year_month_weekday& x,
489da77fe4aSMarshall Clow                          const year_month_weekday& y) noexcept;
490da77fe4aSMarshall Clow
491da77fe4aSMarshall Clowconstexpr year_month_weekday
492da77fe4aSMarshall Clow  operator+(const year_month_weekday& ymwd, const months& dm) noexcept;
493da77fe4aSMarshall Clowconstexpr year_month_weekday
494da77fe4aSMarshall Clow  operator+(const months& dm, const year_month_weekday& ymwd) noexcept;
495da77fe4aSMarshall Clowconstexpr year_month_weekday
496da77fe4aSMarshall Clow  operator+(const year_month_weekday& ymwd, const years& dy) noexcept;
497da77fe4aSMarshall Clowconstexpr year_month_weekday
498da77fe4aSMarshall Clow  operator+(const years& dy, const year_month_weekday& ymwd) noexcept;
499da77fe4aSMarshall Clowconstexpr year_month_weekday
500da77fe4aSMarshall Clow  operator-(const year_month_weekday& ymwd, const months& dm) noexcept;
501da77fe4aSMarshall Clowconstexpr year_month_weekday
502da77fe4aSMarshall Clow  operator-(const year_month_weekday& ymwd, const years& dy) noexcept;
503da77fe4aSMarshall Clow
504da77fe4aSMarshall Clow// 25.8.17, class year_month_weekday_last    // C++20
505da77fe4aSMarshall Clowclass year_month_weekday_last;
506da77fe4aSMarshall Clow
507da77fe4aSMarshall Clowconstexpr bool operator==(const year_month_weekday_last& x,
508da77fe4aSMarshall Clow                          const year_month_weekday_last& y) noexcept;
509da77fe4aSMarshall Clowconstexpr bool operator!=(const year_month_weekday_last& x,
510da77fe4aSMarshall Clow                          const year_month_weekday_last& y) noexcept;
511da77fe4aSMarshall Clowconstexpr year_month_weekday_last
512da77fe4aSMarshall Clow  operator+(const year_month_weekday_last& ymwdl, const months& dm) noexcept;
513da77fe4aSMarshall Clowconstexpr year_month_weekday_last
514da77fe4aSMarshall Clow  operator+(const months& dm, const year_month_weekday_last& ymwdl) noexcept;
515da77fe4aSMarshall Clowconstexpr year_month_weekday_last
516da77fe4aSMarshall Clow  operator+(const year_month_weekday_last& ymwdl, const years& dy) noexcept;
517da77fe4aSMarshall Clowconstexpr year_month_weekday_last
518da77fe4aSMarshall Clow  operator+(const years& dy, const year_month_weekday_last& ymwdl) noexcept;
519da77fe4aSMarshall Clowconstexpr year_month_weekday_last
520da77fe4aSMarshall Clow  operator-(const year_month_weekday_last& ymwdl, const months& dm) noexcept;
521da77fe4aSMarshall Clowconstexpr year_month_weekday_last
522da77fe4aSMarshall Clow  operator-(const year_month_weekday_last& ymwdl, const years& dy) noexcept;
523da77fe4aSMarshall Clow
524da77fe4aSMarshall Clow// 25.8.18, civil calendar conventional syntax operators    // C++20
525da77fe4aSMarshall Clowconstexpr year_month
526da77fe4aSMarshall Clow  operator/(const year& y, const month& m) noexcept;
527da77fe4aSMarshall Clowconstexpr year_month
528da77fe4aSMarshall Clow  operator/(const year& y, int m) noexcept;
529da77fe4aSMarshall Clowconstexpr month_day
530da77fe4aSMarshall Clow  operator/(const month& m, const day& d) noexcept;
531da77fe4aSMarshall Clowconstexpr month_day
532da77fe4aSMarshall Clow  operator/(const month& m, int d) noexcept;
533da77fe4aSMarshall Clowconstexpr month_day
534da77fe4aSMarshall Clow  operator/(int m, const day& d) noexcept;
535da77fe4aSMarshall Clowconstexpr month_day
536da77fe4aSMarshall Clow  operator/(const day& d, const month& m) noexcept;
537da77fe4aSMarshall Clowconstexpr month_day
538da77fe4aSMarshall Clow  operator/(const day& d, int m) noexcept;
539da77fe4aSMarshall Clowconstexpr month_day_last
540da77fe4aSMarshall Clow  operator/(const month& m, last_spec) noexcept;
541da77fe4aSMarshall Clowconstexpr month_day_last
542da77fe4aSMarshall Clow  operator/(int m, last_spec) noexcept;
543da77fe4aSMarshall Clowconstexpr month_day_last
544da77fe4aSMarshall Clow  operator/(last_spec, const month& m) noexcept;
545da77fe4aSMarshall Clowconstexpr month_day_last
546da77fe4aSMarshall Clow  operator/(last_spec, int m) noexcept;
547da77fe4aSMarshall Clowconstexpr month_weekday
548da77fe4aSMarshall Clow  operator/(const month& m, const weekday_indexed& wdi) noexcept;
549da77fe4aSMarshall Clowconstexpr month_weekday
550da77fe4aSMarshall Clow  operator/(int m, const weekday_indexed& wdi) noexcept;
551da77fe4aSMarshall Clowconstexpr month_weekday
552da77fe4aSMarshall Clow  operator/(const weekday_indexed& wdi, const month& m) noexcept;
553da77fe4aSMarshall Clowconstexpr month_weekday
554da77fe4aSMarshall Clow  operator/(const weekday_indexed& wdi, int m) noexcept;
555da77fe4aSMarshall Clowconstexpr month_weekday_last
556da77fe4aSMarshall Clow  operator/(const month& m, const weekday_last& wdl) noexcept;
557da77fe4aSMarshall Clowconstexpr month_weekday_last
558da77fe4aSMarshall Clow  operator/(int m, const weekday_last& wdl) noexcept;
559da77fe4aSMarshall Clowconstexpr month_weekday_last
560da77fe4aSMarshall Clow  operator/(const weekday_last& wdl, const month& m) noexcept;
561da77fe4aSMarshall Clowconstexpr month_weekday_last
562da77fe4aSMarshall Clow  operator/(const weekday_last& wdl, int m) noexcept;
563da77fe4aSMarshall Clowconstexpr year_month_day
564da77fe4aSMarshall Clow  operator/(const year_month& ym, const day& d) noexcept;
565da77fe4aSMarshall Clowconstexpr year_month_day
566da77fe4aSMarshall Clow  operator/(const year_month& ym, int d) noexcept;
567da77fe4aSMarshall Clowconstexpr year_month_day
568da77fe4aSMarshall Clow  operator/(const year& y, const month_day& md) noexcept;
569da77fe4aSMarshall Clowconstexpr year_month_day
570da77fe4aSMarshall Clow  operator/(int y, const month_day& md) noexcept;
571da77fe4aSMarshall Clowconstexpr year_month_day
572da77fe4aSMarshall Clow  operator/(const month_day& md, const year& y) noexcept;
573da77fe4aSMarshall Clowconstexpr year_month_day
574da77fe4aSMarshall Clow  operator/(const month_day& md, int y) noexcept;
575da77fe4aSMarshall Clowconstexpr year_month_day_last
576da77fe4aSMarshall Clow  operator/(const year_month& ym, last_spec) noexcept;
577da77fe4aSMarshall Clowconstexpr year_month_day_last
578da77fe4aSMarshall Clow  operator/(const year& y, const month_day_last& mdl) noexcept;
579da77fe4aSMarshall Clowconstexpr year_month_day_last
580da77fe4aSMarshall Clow  operator/(int y, const month_day_last& mdl) noexcept;
581da77fe4aSMarshall Clowconstexpr year_month_day_last
582da77fe4aSMarshall Clow  operator/(const month_day_last& mdl, const year& y) noexcept;
583da77fe4aSMarshall Clowconstexpr year_month_day_last
584da77fe4aSMarshall Clow  operator/(const month_day_last& mdl, int y) noexcept;
585da77fe4aSMarshall Clowconstexpr year_month_weekday
586da77fe4aSMarshall Clow  operator/(const year_month& ym, const weekday_indexed& wdi) noexcept;
587da77fe4aSMarshall Clowconstexpr year_month_weekday
588da77fe4aSMarshall Clow  operator/(const year& y, const month_weekday& mwd) noexcept;
589da77fe4aSMarshall Clowconstexpr year_month_weekday
590da77fe4aSMarshall Clow  operator/(int y, const month_weekday& mwd) noexcept;
591da77fe4aSMarshall Clowconstexpr year_month_weekday
592da77fe4aSMarshall Clow  operator/(const month_weekday& mwd, const year& y) noexcept;
593da77fe4aSMarshall Clowconstexpr year_month_weekday
594da77fe4aSMarshall Clow  operator/(const month_weekday& mwd, int y) noexcept;
595da77fe4aSMarshall Clowconstexpr year_month_weekday_last
596da77fe4aSMarshall Clow  operator/(const year_month& ym, const weekday_last& wdl) noexcept;
597da77fe4aSMarshall Clowconstexpr year_month_weekday_last
598da77fe4aSMarshall Clow  operator/(const year& y, const month_weekday_last& mwdl) noexcept;
599da77fe4aSMarshall Clowconstexpr year_month_weekday_last
600da77fe4aSMarshall Clow  operator/(int y, const month_weekday_last& mwdl) noexcept;
601da77fe4aSMarshall Clowconstexpr year_month_weekday_last
602da77fe4aSMarshall Clow  operator/(const month_weekday_last& mwdl, const year& y) noexcept;
603da77fe4aSMarshall Clowconstexpr year_month_weekday_last
604da77fe4aSMarshall Clow  operator/(const month_weekday_last& mwdl, int y) noexcept;
605da77fe4aSMarshall Clow
606fde236b1SMarshall Clow// 26.9, class template hh_mm_ss
607fde236b1SMarshall Clowtemplate <class Duration>
608fde236b1SMarshall Clowclass hh_mm_ss
609fde236b1SMarshall Clow{
610fde236b1SMarshall Clow    bool            is_neg; // exposition only
611fde236b1SMarshall Clow    chrono::hours   h;      // exposition only
612fde236b1SMarshall Clow    chrono::minutes m;      // exposition only
613fde236b1SMarshall Clow    chrono::seconds s;      // exposition only
614fde236b1SMarshall Clow    precision       ss;     // exposition only
615da77fe4aSMarshall Clow
616fde236b1SMarshall Clowpublic:
617fde236b1SMarshall Clow    static unsigned constexpr fractional_width = see below;
618fde236b1SMarshall Clow    using precision                            = see below;
619fde236b1SMarshall Clow
620fde236b1SMarshall Clow    constexpr hh_mm_ss() noexcept : hh_mm_ss{Duration::zero()} {}
621fde236b1SMarshall Clow    constexpr explicit hh_mm_ss(Duration d) noexcept;
622fde236b1SMarshall Clow
623fde236b1SMarshall Clow    constexpr bool is_negative() const noexcept;
624fde236b1SMarshall Clow    constexpr chrono::hours hours() const noexcept;
625fde236b1SMarshall Clow    constexpr chrono::minutes minutes() const noexcept;
626fde236b1SMarshall Clow    constexpr chrono::seconds seconds() const noexcept;
627fde236b1SMarshall Clow    constexpr precision subseconds() const noexcept;
628fde236b1SMarshall Clow
629fde236b1SMarshall Clow    constexpr explicit operator  precision()   const noexcept;
630fde236b1SMarshall Clow    constexpr          precision to_duration() const noexcept;
631fde236b1SMarshall Clow};
632fde236b1SMarshall Clow
633fde236b1SMarshall Clow// 26.10, 12/24 hour functions
634fde236b1SMarshall Clowconstexpr bool is_am(hours const& h) noexcept;
635fde236b1SMarshall Clowconstexpr bool is_pm(hours const& h) noexcept;
636fde236b1SMarshall Clowconstexpr hours make12(const hours& h) noexcept;
637fde236b1SMarshall Clowconstexpr hours make24(const hours& h, bool is_pm) noexcept;
638fde236b1SMarshall Clow
639da77fe4aSMarshall Clow// 25.10.5, class time_zone    // C++20
640da77fe4aSMarshall Clowenum class choose {earliest, latest};
641da77fe4aSMarshall Clowclass time_zone;
642da77fe4aSMarshall Clowbool operator==(const time_zone& x, const time_zone& y) noexcept;
643da77fe4aSMarshall Clowbool operator!=(const time_zone& x, const time_zone& y) noexcept;
644da77fe4aSMarshall Clowbool operator<(const time_zone& x, const time_zone& y) noexcept;
645da77fe4aSMarshall Clowbool operator>(const time_zone& x, const time_zone& y) noexcept;
646da77fe4aSMarshall Clowbool operator<=(const time_zone& x, const time_zone& y) noexcept;
647da77fe4aSMarshall Clowbool operator>=(const time_zone& x, const time_zone& y) noexcept;
648da77fe4aSMarshall Clow
6495b08c174SMarshall Clow// calendrical constants
650da77fe4aSMarshall Clowinline constexpr last_spec                              last{};       // C++20
651da77fe4aSMarshall Clowinline constexpr chrono::weekday                        Sunday{0};    // C++20
652da77fe4aSMarshall Clowinline constexpr chrono::weekday                        Monday{1};    // C++20
653da77fe4aSMarshall Clowinline constexpr chrono::weekday                        Tuesday{2};   // C++20
654da77fe4aSMarshall Clowinline constexpr chrono::weekday                        Wednesday{3}; // C++20
655da77fe4aSMarshall Clowinline constexpr chrono::weekday                        Thursday{4};  // C++20
656da77fe4aSMarshall Clowinline constexpr chrono::weekday                        Friday{5};    // C++20
657da77fe4aSMarshall Clowinline constexpr chrono::weekday                        Saturday{6};  // C++20
658da77fe4aSMarshall Clow
659da77fe4aSMarshall Clowinline constexpr chrono::month                          January{1};   // C++20
660da77fe4aSMarshall Clowinline constexpr chrono::month                          February{2};  // C++20
661da77fe4aSMarshall Clowinline constexpr chrono::month                          March{3};     // C++20
662da77fe4aSMarshall Clowinline constexpr chrono::month                          April{4};     // C++20
663da77fe4aSMarshall Clowinline constexpr chrono::month                          May{5};       // C++20
664da77fe4aSMarshall Clowinline constexpr chrono::month                          June{6};      // C++20
665da77fe4aSMarshall Clowinline constexpr chrono::month                          July{7};      // C++20
666da77fe4aSMarshall Clowinline constexpr chrono::month                          August{8};    // C++20
667da77fe4aSMarshall Clowinline constexpr chrono::month                          September{9}; // C++20
668da77fe4aSMarshall Clowinline constexpr chrono::month                          October{10};  // C++20
669da77fe4aSMarshall Clowinline constexpr chrono::month                          November{11}; // C++20
670da77fe4aSMarshall Clowinline constexpr chrono::month                          December{12}; // C++20
6713e519524SHoward Hinnant}  // chrono
6723e519524SHoward Hinnant
673da77fe4aSMarshall Clowinline namespace literals {
674da77fe4aSMarshall Clow  inline namespace chrono_literals {
6757aa54577SMarshall Clowconstexpr chrono::hours                                 operator ""h(unsigned long long); // C++14
6767aa54577SMarshall Clowconstexpr chrono::duration<unspecified , ratio<3600,1>> operator ""h(long double); // C++14
6777aa54577SMarshall Clowconstexpr chrono::minutes                               operator ""min(unsigned long long); // C++14
6787aa54577SMarshall Clowconstexpr chrono::duration<unspecified , ratio<60,1>>   operator ""min(long double); // C++14
6797aa54577SMarshall Clowconstexpr chrono::seconds                               operator ""s(unsigned long long); // C++14
6807aa54577SMarshall Clowconstexpr chrono::duration<unspecified >                operator ""s(long double); // C++14
6817aa54577SMarshall Clowconstexpr chrono::milliseconds                          operator ""ms(unsigned long long); // C++14
6827aa54577SMarshall Clowconstexpr chrono::duration<unspecified , milli>         operator ""ms(long double); // C++14
6837aa54577SMarshall Clowconstexpr chrono::microseconds                          operator ""us(unsigned long long); // C++14
6847aa54577SMarshall Clowconstexpr chrono::duration<unspecified , micro>         operator ""us(long double); // C++14
6857aa54577SMarshall Clowconstexpr chrono::nanoseconds                           operator ""ns(unsigned long long); // C++14
6867aa54577SMarshall Clowconstexpr chrono::duration<unspecified , nano>          operator ""ns(long double); // C++14
687da77fe4aSMarshall Clowconstexpr chrono::day                                   operator ""d(unsigned long long d) noexcept; // C++20
688da77fe4aSMarshall Clowconstexpr chrono::year                                  operator ""y(unsigned long long y) noexcept; // C++20
689da77fe4aSMarshall Clow}  // chrono_literals
690da77fe4aSMarshall Clow}  // literals
6917aa54577SMarshall Clow
6923e519524SHoward Hinnant}  // std
6933e519524SHoward Hinnant*/
6943e519524SHoward Hinnant
695385cc25aSLouis Dionne#include <__assert> // all public C++ headers provide the assertion handler
6965726e559SLouis Dionne#include <__chrono/calendar.h>
697df51be85SLouis Dionne#include <__chrono/convert_to_timespec.h>
698d7862497SMark de Wever#include <__chrono/day.h>
6995726e559SLouis Dionne#include <__chrono/duration.h>
7005726e559SLouis Dionne#include <__chrono/file_clock.h>
701d7862497SMark de Wever#include <__chrono/hh_mm_ss.h>
7025726e559SLouis Dionne#include <__chrono/high_resolution_clock.h>
703d7862497SMark de Wever#include <__chrono/literals.h>
704d7862497SMark de Wever#include <__chrono/month.h>
705d7862497SMark de Wever#include <__chrono/month_weekday.h>
706d7862497SMark de Wever#include <__chrono/monthday.h>
7075726e559SLouis Dionne#include <__chrono/steady_clock.h>
7085726e559SLouis Dionne#include <__chrono/system_clock.h>
7095726e559SLouis Dionne#include <__chrono/time_point.h>
710d7862497SMark de Wever#include <__chrono/weekday.h>
711d7862497SMark de Wever#include <__chrono/year.h>
712d7862497SMark de Wever#include <__chrono/year_month.h>
713d7862497SMark de Wever#include <__chrono/year_month_day.h>
714d7862497SMark de Wever#include <__chrono/year_month_weekday.h>
715bfbd73f8SArthur O'Dwyer#include <__config>
716f56972e2SMarshall Clow#include <version>
7173e519524SHoward Hinnant
718*fd36a3d4SMark de Wever// standard-mandated includes
719*fd36a3d4SMark de Wever#include <compare>
720*fd36a3d4SMark de Wever
721073458b1SHoward Hinnant#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
7223e519524SHoward Hinnant#  pragma GCC system_header
723073458b1SHoward Hinnant#endif
7243e519524SHoward Hinnant
7253e519524SHoward Hinnant#endif // _LIBCPP_CHRONO
726