xref: /freebsd/contrib/llvm-project/libcxx/include/chrono (revision c80e69b00d976a5a3b3e84527f270fa7e72a8205)
10b57cec5SDimitry Andric// -*- C++ -*-
2349cc55cSDimitry Andric//===----------------------------------------------------------------------===//
30b57cec5SDimitry Andric//
40b57cec5SDimitry Andric// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
50b57cec5SDimitry Andric// See https://llvm.org/LICENSE.txt for license information.
60b57cec5SDimitry Andric// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
70b57cec5SDimitry Andric//
80b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
90b57cec5SDimitry Andric
100b57cec5SDimitry Andric#ifndef _LIBCPP_CHRONO
110b57cec5SDimitry Andric#define _LIBCPP_CHRONO
120b57cec5SDimitry Andric
135f757f3fSDimitry Andric// clang-format off
145f757f3fSDimitry Andric
150b57cec5SDimitry Andric/*
160b57cec5SDimitry Andric    chrono synopsis
170b57cec5SDimitry Andric
18753f127fSDimitry Andric#include <compare> // C++20
19753f127fSDimitry Andric
200b57cec5SDimitry Andricnamespace std
210b57cec5SDimitry Andric{
220b57cec5SDimitry Andricnamespace chrono
230b57cec5SDimitry Andric{
240b57cec5SDimitry Andric
250b57cec5SDimitry Andrictemplate <class ToDuration, class Rep, class Period>
260b57cec5SDimitry Andricconstexpr
270b57cec5SDimitry AndricToDuration
280b57cec5SDimitry Andricduration_cast(const duration<Rep, Period>& fd);
290b57cec5SDimitry Andric
300b57cec5SDimitry Andrictemplate <class Rep> struct treat_as_floating_point : is_floating_point<Rep> {};
310b57cec5SDimitry Andric
320b57cec5SDimitry Andrictemplate <class Rep> inline constexpr bool treat_as_floating_point_v
330b57cec5SDimitry Andric    = treat_as_floating_point<Rep>::value;                       // C++17
340b57cec5SDimitry Andric
350b57cec5SDimitry Andrictemplate <class Rep>
360b57cec5SDimitry Andricstruct duration_values
370b57cec5SDimitry Andric{
380b57cec5SDimitry Andricpublic:
390b57cec5SDimitry Andric    static constexpr Rep zero(); // noexcept in C++20
400b57cec5SDimitry Andric    static constexpr Rep max();  // noexcept in C++20
410b57cec5SDimitry Andric    static constexpr Rep min();  // noexcept in C++20
420b57cec5SDimitry Andric};
430b57cec5SDimitry Andric
440b57cec5SDimitry Andric// duration
450b57cec5SDimitry Andric
460b57cec5SDimitry Andrictemplate <class Rep, class Period = ratio<1>>
470b57cec5SDimitry Andricclass duration
480b57cec5SDimitry Andric{
490b57cec5SDimitry Andric    static_assert(!__is_duration<Rep>::value, "A duration representation can not be a duration");
500b57cec5SDimitry Andric    static_assert(__is_ratio<Period>::value, "Second template parameter of duration must be a std::ratio");
510b57cec5SDimitry Andric    static_assert(Period::num > 0, "duration period must be positive");
520b57cec5SDimitry Andricpublic:
530b57cec5SDimitry Andric    typedef Rep rep;
540b57cec5SDimitry Andric    typedef typename _Period::type period;
550b57cec5SDimitry Andric
560b57cec5SDimitry Andric    constexpr duration() = default;
570b57cec5SDimitry Andric    template <class Rep2>
580b57cec5SDimitry Andric        constexpr explicit duration(const Rep2& r,
590b57cec5SDimitry Andric            typename enable_if
600b57cec5SDimitry Andric            <
610fca6ea1SDimitry Andric               is_convertible<const Rep2&, rep>::value &&
620b57cec5SDimitry Andric               (treat_as_floating_point<rep>::value ||
630b57cec5SDimitry Andric               !treat_as_floating_point<rep>::value && !treat_as_floating_point<Rep2>::value)
640b57cec5SDimitry Andric            >::type* = 0);
650b57cec5SDimitry Andric
660b57cec5SDimitry Andric    // conversions
670b57cec5SDimitry Andric    template <class Rep2, class Period2>
680b57cec5SDimitry Andric        constexpr duration(const duration<Rep2, Period2>& d,
690b57cec5SDimitry Andric            typename enable_if
700b57cec5SDimitry Andric            <
710b57cec5SDimitry Andric                treat_as_floating_point<rep>::value ||
720b57cec5SDimitry Andric                ratio_divide<Period2, period>::type::den == 1
730b57cec5SDimitry Andric            >::type* = 0);
740b57cec5SDimitry Andric
750b57cec5SDimitry Andric    // observer
760b57cec5SDimitry Andric
770b57cec5SDimitry Andric    constexpr rep count() const;
780b57cec5SDimitry Andric
790b57cec5SDimitry Andric    // arithmetic
800b57cec5SDimitry Andric
810b57cec5SDimitry Andric    constexpr common_type<duration>::type  operator+() const;
820b57cec5SDimitry Andric    constexpr common_type<duration>::type  operator-() const;
830b57cec5SDimitry Andric    constexpr duration& operator++();    // constexpr in C++17
840b57cec5SDimitry Andric    constexpr duration  operator++(int); // constexpr in C++17
850b57cec5SDimitry Andric    constexpr duration& operator--();    // constexpr in C++17
860b57cec5SDimitry Andric    constexpr duration  operator--(int); // constexpr in C++17
870b57cec5SDimitry Andric
880b57cec5SDimitry Andric    constexpr duration& operator+=(const duration& d);  // constexpr in C++17
890b57cec5SDimitry Andric    constexpr duration& operator-=(const duration& d);  // constexpr in C++17
900b57cec5SDimitry Andric
910b57cec5SDimitry Andric    duration& operator*=(const rep& rhs);       // constexpr in C++17
920b57cec5SDimitry Andric    duration& operator/=(const rep& rhs);       // constexpr in C++17
930b57cec5SDimitry Andric    duration& operator%=(const rep& rhs);       // constexpr in C++17
940b57cec5SDimitry Andric    duration& operator%=(const duration& rhs);  // constexpr in C++17
950b57cec5SDimitry Andric
960b57cec5SDimitry Andric    // special values
970b57cec5SDimitry Andric
980b57cec5SDimitry Andric    static constexpr duration zero(); // noexcept in C++20
990b57cec5SDimitry Andric    static constexpr duration min();  // noexcept in C++20
1000b57cec5SDimitry Andric    static constexpr duration max();  // noexcept in C++20
1010b57cec5SDimitry Andric};
1020b57cec5SDimitry Andric
1030b57cec5SDimitry Andrictypedef duration<long long,         nano> nanoseconds;
1040b57cec5SDimitry Andrictypedef duration<long long,        micro> microseconds;
1050b57cec5SDimitry Andrictypedef duration<long long,        milli> milliseconds;
1060b57cec5SDimitry Andrictypedef duration<long long              > seconds;
1070b57cec5SDimitry Andrictypedef duration<     long, ratio<  60> > minutes;
1080b57cec5SDimitry Andrictypedef duration<     long, ratio<3600> > hours;
1090b57cec5SDimitry Andric
1100b57cec5SDimitry Andrictemplate <class Clock, class Duration = typename Clock::duration>
1110b57cec5SDimitry Andricclass time_point
1120b57cec5SDimitry Andric{
1130b57cec5SDimitry Andricpublic:
1140b57cec5SDimitry Andric    typedef Clock                     clock;
1150b57cec5SDimitry Andric    typedef Duration                  duration;
1160b57cec5SDimitry Andric    typedef typename duration::rep    rep;
1170b57cec5SDimitry Andric    typedef typename duration::period period;
1180b57cec5SDimitry Andricprivate:
1190b57cec5SDimitry Andric    duration d_;  // exposition only
1200b57cec5SDimitry Andric
1210b57cec5SDimitry Andricpublic:
1220b57cec5SDimitry Andric    time_point();  // has value "epoch" // constexpr in C++14
1230b57cec5SDimitry Andric    explicit time_point(const duration& d);  // same as time_point() + d // constexpr in C++14
1240b57cec5SDimitry Andric
1250b57cec5SDimitry Andric    // conversions
1260b57cec5SDimitry Andric    template <class Duration2>
1270b57cec5SDimitry Andric       time_point(const time_point<clock, Duration2>& t); // constexpr in C++14
1280b57cec5SDimitry Andric
1290b57cec5SDimitry Andric    // observer
1300b57cec5SDimitry Andric
1310b57cec5SDimitry Andric    duration time_since_epoch() const; // constexpr in C++14
1320b57cec5SDimitry Andric
1330b57cec5SDimitry Andric    // arithmetic
1340b57cec5SDimitry Andric
1350b57cec5SDimitry Andric    time_point& operator+=(const duration& d); // constexpr in C++17
1360b57cec5SDimitry Andric    time_point& operator-=(const duration& d); // constexpr in C++17
1370b57cec5SDimitry Andric
1380b57cec5SDimitry Andric    // special values
1390b57cec5SDimitry Andric
1400b57cec5SDimitry Andric    static constexpr time_point min();  // noexcept in C++20
1410b57cec5SDimitry Andric    static constexpr time_point max();  // noexcept in C++20
1420b57cec5SDimitry Andric};
1430b57cec5SDimitry Andric
1440b57cec5SDimitry Andric} // chrono
1450b57cec5SDimitry Andric
1460b57cec5SDimitry Andric// common_type traits
1470b57cec5SDimitry Andrictemplate <class Rep1, class Period1, class Rep2, class Period2>
1480b57cec5SDimitry Andric  struct common_type<chrono::duration<Rep1, Period1>, chrono::duration<Rep2, Period2>>;
1490b57cec5SDimitry Andric
1500b57cec5SDimitry Andrictemplate <class Clock, class Duration1, class Duration2>
1510b57cec5SDimitry Andric  struct common_type<chrono::time_point<Clock, Duration1>, chrono::time_point<Clock, Duration2>>;
1520b57cec5SDimitry Andric
1530b57cec5SDimitry Andricnamespace chrono {
1540b57cec5SDimitry Andric
1550b57cec5SDimitry Andric// duration arithmetic
1560b57cec5SDimitry Andrictemplate <class Rep1, class Period1, class Rep2, class Period2>
1570b57cec5SDimitry Andric  constexpr
1580b57cec5SDimitry Andric  typename common_type<duration<Rep1, Period1>, duration<Rep2, Period2>>::type
1590b57cec5SDimitry Andric  operator+(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
1600b57cec5SDimitry Andrictemplate <class Rep1, class Period1, class Rep2, class Period2>
1610b57cec5SDimitry Andric  constexpr
1620b57cec5SDimitry Andric  typename common_type<duration<Rep1, Period1>, duration<Rep2, Period2>>::type
1630b57cec5SDimitry Andric  operator-(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
1640b57cec5SDimitry Andrictemplate <class Rep1, class Period, class Rep2>
1650b57cec5SDimitry Andric  constexpr
1660b57cec5SDimitry Andric  duration<typename common_type<Rep1, Rep2>::type, Period>
1670b57cec5SDimitry Andric  operator*(const duration<Rep1, Period>& d, const Rep2& s);
1680b57cec5SDimitry Andrictemplate <class Rep1, class Period, class Rep2>
1690b57cec5SDimitry Andric  constexpr
1700b57cec5SDimitry Andric  duration<typename common_type<Rep1, Rep2>::type, Period>
1710b57cec5SDimitry Andric  operator*(const Rep1& s, const duration<Rep2, Period>& d);
1720b57cec5SDimitry Andrictemplate <class Rep1, class Period, class Rep2>
1730b57cec5SDimitry Andric  constexpr
1740b57cec5SDimitry Andric  duration<typename common_type<Rep1, Rep2>::type, Period>
1750b57cec5SDimitry Andric  operator/(const duration<Rep1, Period>& d, const Rep2& s);
1760b57cec5SDimitry Andrictemplate <class Rep1, class Period1, class Rep2, class Period2>
1770b57cec5SDimitry Andric  constexpr
1780b57cec5SDimitry Andric  typename common_type<Rep1, Rep2>::type
1790b57cec5SDimitry Andric  operator/(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
1800b57cec5SDimitry Andric
1810b57cec5SDimitry Andric// duration comparisons
1820b57cec5SDimitry Andrictemplate <class Rep1, class Period1, class Rep2, class Period2>
1830b57cec5SDimitry Andric   constexpr
1840b57cec5SDimitry Andric   bool operator==(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
1850b57cec5SDimitry Andrictemplate <class Rep1, class Period1, class Rep2, class Period2>
1860b57cec5SDimitry Andric   constexpr
18706c3fb27SDimitry Andric   bool operator!=(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs); // removed in C++20
1880b57cec5SDimitry Andrictemplate <class Rep1, class Period1, class Rep2, class Period2>
1890b57cec5SDimitry Andric   constexpr
1900b57cec5SDimitry Andric   bool operator< (const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
1910b57cec5SDimitry Andrictemplate <class Rep1, class Period1, class Rep2, class Period2>
1920b57cec5SDimitry Andric   constexpr
1930b57cec5SDimitry Andric   bool operator<=(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
1940b57cec5SDimitry Andrictemplate <class Rep1, class Period1, class Rep2, class Period2>
1950b57cec5SDimitry Andric   constexpr
1960b57cec5SDimitry Andric   bool operator> (const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
1970b57cec5SDimitry Andrictemplate <class Rep1, class Period1, class Rep2, class Period2>
1980b57cec5SDimitry Andric   constexpr
1990b57cec5SDimitry Andric   bool operator>=(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
20006c3fb27SDimitry Andrictemplate<class Rep1, class Period1, class Rep2, class Period2>
20106c3fb27SDimitry Andric  requires three_way_comparable<typename CT::rep>
20206c3fb27SDimitry Andric  constexpr auto operator<=>(const duration<Rep1, Period1>& lhs,
20306c3fb27SDimitry Andric                             const duration<Rep2, Period2>& rhs);                           // since C++20
2040b57cec5SDimitry Andric
2050b57cec5SDimitry Andric// duration_cast
2060b57cec5SDimitry Andrictemplate <class ToDuration, class Rep, class Period>
2070b57cec5SDimitry Andric  ToDuration duration_cast(const duration<Rep, Period>& d);
2080b57cec5SDimitry Andric
2090b57cec5SDimitry Andrictemplate <class ToDuration, class Rep, class Period>
2100b57cec5SDimitry Andric    constexpr ToDuration floor(const duration<Rep, Period>& d);    // C++17
2110b57cec5SDimitry Andrictemplate <class ToDuration, class Rep, class Period>
2120b57cec5SDimitry Andric    constexpr ToDuration ceil(const duration<Rep, Period>& d);     // C++17
2130b57cec5SDimitry Andrictemplate <class ToDuration, class Rep, class Period>
2140b57cec5SDimitry Andric    constexpr ToDuration round(const duration<Rep, Period>& d);    // C++17
2150b57cec5SDimitry Andric
216bdd1243dSDimitry Andric// duration I/O
217bdd1243dSDimitry Andrictemplate<class charT, class traits, class Rep, class Period>       // C++20
218bdd1243dSDimitry Andric  basic_ostream<charT, traits>&
219bdd1243dSDimitry Andric    operator<<(basic_ostream<charT, traits>& os,
220bdd1243dSDimitry Andric               const duration<Rep, Period>& d);
2210b57cec5SDimitry Andric
2220b57cec5SDimitry Andric// time_point arithmetic (all constexpr in C++14)
2230b57cec5SDimitry Andrictemplate <class Clock, class Duration1, class Rep2, class Period2>
2240b57cec5SDimitry Andric  time_point<Clock, typename common_type<Duration1, duration<Rep2, Period2>>::type>
2250b57cec5SDimitry Andric  operator+(const time_point<Clock, Duration1>& lhs, const duration<Rep2, Period2>& rhs);
2260b57cec5SDimitry Andrictemplate <class Rep1, class Period1, class Clock, class Duration2>
2270b57cec5SDimitry Andric  time_point<Clock, typename common_type<duration<Rep1, Period1>, Duration2>::type>
2280b57cec5SDimitry Andric  operator+(const duration<Rep1, Period1>& lhs, const time_point<Clock, Duration2>& rhs);
2290b57cec5SDimitry Andrictemplate <class Clock, class Duration1, class Rep2, class Period2>
2300b57cec5SDimitry Andric  time_point<Clock, typename common_type<Duration1, duration<Rep2, Period2>>::type>
2310b57cec5SDimitry Andric  operator-(const time_point<Clock, Duration1>& lhs, const duration<Rep2, Period2>& rhs);
2320b57cec5SDimitry Andrictemplate <class Clock, class Duration1, class Duration2>
2330b57cec5SDimitry Andric  typename common_type<Duration1, Duration2>::type
2340b57cec5SDimitry Andric  operator-(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
2350b57cec5SDimitry Andric
2360b57cec5SDimitry Andric// time_point comparisons (all constexpr in C++14)
2370b57cec5SDimitry Andrictemplate <class Clock, class Duration1, class Duration2>
2380b57cec5SDimitry Andric   bool operator==(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
2390b57cec5SDimitry Andrictemplate <class Clock, class Duration1, class Duration2>
24006c3fb27SDimitry Andric   bool operator!=(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs); // removed in C++20
2410b57cec5SDimitry Andrictemplate <class Clock, class Duration1, class Duration2>
2420b57cec5SDimitry Andric   bool operator< (const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
2430b57cec5SDimitry Andrictemplate <class Clock, class Duration1, class Duration2>
2440b57cec5SDimitry Andric   bool operator<=(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
2450b57cec5SDimitry Andrictemplate <class Clock, class Duration1, class Duration2>
2460b57cec5SDimitry Andric   bool operator> (const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
2470b57cec5SDimitry Andrictemplate <class Clock, class Duration1, class Duration2>
2480b57cec5SDimitry Andric   bool operator>=(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
24906c3fb27SDimitry Andrictemplate<class Clock, class Duration1,
25006c3fb27SDimitry Andric         three_way_comparable_with<Duration1> Duration2>
25106c3fb27SDimitry Andric  constexpr auto operator<=>(const time_point<Clock, Duration1>& lhs,
25206c3fb27SDimitry Andric                             const time_point<Clock, Duration2>& rhs);                                // since C++20
2530b57cec5SDimitry Andric
2540b57cec5SDimitry Andric// time_point_cast (constexpr in C++14)
2550b57cec5SDimitry Andric
2560b57cec5SDimitry Andrictemplate <class ToDuration, class Clock, class Duration>
2570b57cec5SDimitry Andric  time_point<Clock, ToDuration> time_point_cast(const time_point<Clock, Duration>& t);
2580b57cec5SDimitry Andric
2590b57cec5SDimitry Andrictemplate <class ToDuration, class Clock, class Duration>
2600b57cec5SDimitry Andric    constexpr time_point<Clock, ToDuration>
2610b57cec5SDimitry Andric    floor(const time_point<Clock, Duration>& tp);                  // C++17
2620b57cec5SDimitry Andric
2630b57cec5SDimitry Andrictemplate <class ToDuration, class Clock, class Duration>
2640b57cec5SDimitry Andric    constexpr time_point<Clock, ToDuration>
2650b57cec5SDimitry Andric    ceil(const time_point<Clock, Duration>& tp);                   // C++17
2660b57cec5SDimitry Andric
2670b57cec5SDimitry Andrictemplate <class ToDuration, class Clock, class Duration>
2680b57cec5SDimitry Andric    constexpr time_point<Clock, ToDuration>
2690b57cec5SDimitry Andric    round(const time_point<Clock, Duration>& tp);                  // C++17
2700b57cec5SDimitry Andric
2710b57cec5SDimitry Andrictemplate <class Rep, class Period>
2720b57cec5SDimitry Andric    constexpr duration<Rep, Period> abs(duration<Rep, Period> d);  // C++17
2730b57cec5SDimitry Andric
2740b57cec5SDimitry Andric// Clocks
2750b57cec5SDimitry Andric
2760b57cec5SDimitry Andricclass system_clock
2770b57cec5SDimitry Andric{
2780b57cec5SDimitry Andricpublic:
2790b57cec5SDimitry Andric    typedef microseconds                     duration;
2800b57cec5SDimitry Andric    typedef duration::rep                    rep;
2810b57cec5SDimitry Andric    typedef duration::period                 period;
2820b57cec5SDimitry Andric    typedef chrono::time_point<system_clock> time_point;
2830b57cec5SDimitry Andric    static const bool is_steady =            false; // constexpr in C++14
2840b57cec5SDimitry Andric
2850b57cec5SDimitry Andric    static time_point now() noexcept;
2860b57cec5SDimitry Andric    static time_t     to_time_t  (const time_point& __t) noexcept;
2870b57cec5SDimitry Andric    static time_point from_time_t(time_t __t) noexcept;
2880b57cec5SDimitry Andric};
2890b57cec5SDimitry Andric
2900b57cec5SDimitry Andrictemplate <class Duration>
2910b57cec5SDimitry Andric  using sys_time  = time_point<system_clock, Duration>; // C++20
2920b57cec5SDimitry Andricusing sys_seconds = sys_time<seconds>;                  // C++20
2930b57cec5SDimitry Andricusing sys_days    = sys_time<days>;                     // C++20
2940b57cec5SDimitry Andric
29506c3fb27SDimitry Andrictemplate<class charT, class traits, class Duration>     // C++20
29606c3fb27SDimitry Andric  basic_ostream<charT, traits>&
29706c3fb27SDimitry Andric    operator<<(basic_ostream<charT, traits>& os, const sys_time<Duration>& tp);
29806c3fb27SDimitry Andric
2997a6dacacSDimitry Andrictemplate<class charT, class traits>                    // C++20
3007a6dacacSDimitry Andric  basic_ostream<charT, traits>&
3017a6dacacSDimitry Andric    operator<<(basic_ostream<charT, traits>& os, const sys_days& dp);
3027a6dacacSDimitry Andric
303349cc55cSDimitry Andricclass file_clock                                        // C++20
304349cc55cSDimitry Andric{
305349cc55cSDimitry Andricpublic:
306349cc55cSDimitry Andric    typedef see-below                      rep;
307349cc55cSDimitry Andric    typedef nano                           period;
308349cc55cSDimitry Andric    typedef chrono::duration<rep, period>  duration;
309349cc55cSDimitry Andric    typedef chrono::time_point<file_clock> time_point;
310349cc55cSDimitry Andric    static constexpr bool is_steady =      false;
311349cc55cSDimitry Andric
312349cc55cSDimitry Andric    static time_point now() noexcept;
3130b57cec5SDimitry Andric
3140b57cec5SDimitry Andric    template<class Duration>
315349cc55cSDimitry Andric    static sys_time<see-below> to_sys(const file_time<Duration>&);
3160b57cec5SDimitry Andric
3170b57cec5SDimitry Andric    template<class Duration>
318349cc55cSDimitry Andric    static file_time<see-below> from_sys(const sys_time<Duration>&);
319349cc55cSDimitry Andric};
3200b57cec5SDimitry Andric
3210b57cec5SDimitry Andrictemplate<class Duration>
3220b57cec5SDimitry Andric  using file_time = time_point<file_clock, Duration>;   // C++20
3230b57cec5SDimitry Andric
32406c3fb27SDimitry Andrictemplate<class charT, class traits, class Duration>     // C++20
32506c3fb27SDimitry Andric  basic_ostream<charT, traits>&
32606c3fb27SDimitry Andric    operator<<(basic_ostream<charT, traits>& os, const file_time<Duration>& tp);
32706c3fb27SDimitry Andric
3280b57cec5SDimitry Andricclass steady_clock
3290b57cec5SDimitry Andric{
3300b57cec5SDimitry Andricpublic:
3310b57cec5SDimitry Andric    typedef nanoseconds                                   duration;
3320b57cec5SDimitry Andric    typedef duration::rep                                 rep;
3330b57cec5SDimitry Andric    typedef duration::period                              period;
3340b57cec5SDimitry Andric    typedef chrono::time_point<steady_clock, duration>    time_point;
3350b57cec5SDimitry Andric    static const bool is_steady =                         true; // constexpr in C++14
3360b57cec5SDimitry Andric
3370b57cec5SDimitry Andric    static time_point now() noexcept;
3380b57cec5SDimitry Andric};
3390b57cec5SDimitry Andric
3400b57cec5SDimitry Andrictypedef steady_clock high_resolution_clock;
3410b57cec5SDimitry Andric
3420b57cec5SDimitry Andric// 25.7.8, local time           // C++20
3430b57cec5SDimitry Andricstruct local_t {};
3440b57cec5SDimitry Andrictemplate<class Duration>
3450b57cec5SDimitry Andric  using local_time  = time_point<local_t, Duration>;
3460b57cec5SDimitry Andricusing local_seconds = local_time<seconds>;
3470b57cec5SDimitry Andricusing local_days    = local_time<days>;
3480b57cec5SDimitry Andric
34906c3fb27SDimitry Andrictemplate<class charT, class traits, class Duration>     // C++20
35006c3fb27SDimitry Andric  basic_ostream<charT, traits>&
35106c3fb27SDimitry Andric    operator<<(basic_ostream<charT, traits>& os, const local_time<Duration>& tp);
35206c3fb27SDimitry Andric
3530b57cec5SDimitry Andric// 25.8.2, class last_spec    // C++20
3540b57cec5SDimitry Andricstruct last_spec;
3550b57cec5SDimitry Andric
3560b57cec5SDimitry Andric// 25.8.3, class day          // C++20
3570b57cec5SDimitry Andric
3580b57cec5SDimitry Andricclass day;
3590b57cec5SDimitry Andricconstexpr bool operator==(const day& x, const day& y) noexcept;
360753f127fSDimitry Andricconstexpr strong_ordering operator<=>(const day& x, const day& y) noexcept;
3610b57cec5SDimitry Andricconstexpr day  operator+(const day&  x, const days& y) noexcept;
3620b57cec5SDimitry Andricconstexpr day  operator+(const days& x, const day&  y) noexcept;
3630b57cec5SDimitry Andricconstexpr day  operator-(const day&  x, const days& y) noexcept;
3640b57cec5SDimitry Andricconstexpr days operator-(const day&  x, const day&  y) noexcept;
365bdd1243dSDimitry Andrictemplate<class charT, class traits>
366bdd1243dSDimitry Andric  basic_ostream<charT, traits>&
367bdd1243dSDimitry Andric    operator<<(basic_ostream<charT, traits>& os, const day& d);
3680b57cec5SDimitry Andric
3690b57cec5SDimitry Andric// 25.8.4, class month    // C++20
3700b57cec5SDimitry Andricclass month;
3710b57cec5SDimitry Andricconstexpr bool operator==(const month& x, const month& y) noexcept;
372bdd1243dSDimitry Andricconstexpr strong_ordering operator<=>(const month& x, const month& y) noexcept;
373bdd1243dSDimitry Andric
3740b57cec5SDimitry Andricconstexpr month  operator+(const month&  x, const months& y) noexcept;
3750b57cec5SDimitry Andricconstexpr month  operator+(const months& x,  const month& y) noexcept;
3760b57cec5SDimitry Andricconstexpr month  operator-(const month&  x, const months& y) noexcept;
3770b57cec5SDimitry Andricconstexpr months operator-(const month&  x,  const month& y) noexcept;
378bdd1243dSDimitry Andrictemplate<class charT, class traits>
379bdd1243dSDimitry Andric  basic_ostream<charT, traits>&
380bdd1243dSDimitry Andric    operator<<(basic_ostream<charT, traits>& os, const month& m);
3810b57cec5SDimitry Andric
3820b57cec5SDimitry Andric// 25.8.5, class year    // C++20
3830b57cec5SDimitry Andricclass year;
3840b57cec5SDimitry Andricconstexpr bool operator==(const year& x, const year& y) noexcept;
385bdd1243dSDimitry Andricconstexpr strong_ordering operator<=>(const year& x, const year& y) noexcept;
386bdd1243dSDimitry Andric
3870b57cec5SDimitry Andricconstexpr year  operator+(const year&  x, const years& y) noexcept;
3880b57cec5SDimitry Andricconstexpr year  operator+(const years& x, const year&  y) noexcept;
3890b57cec5SDimitry Andricconstexpr year  operator-(const year&  x, const years& y) noexcept;
3900b57cec5SDimitry Andricconstexpr years operator-(const year&  x, const year&  y) noexcept;
391bdd1243dSDimitry Andrictemplate<class charT, class traits>
392bdd1243dSDimitry Andric  basic_ostream<charT, traits>&
393bdd1243dSDimitry Andric    operator<<(basic_ostream<charT, traits>& os, const year& y);
3940b57cec5SDimitry Andric
3950b57cec5SDimitry Andric// 25.8.6, class weekday    // C++20
3960b57cec5SDimitry Andricclass weekday;
3970b57cec5SDimitry Andric
3980b57cec5SDimitry Andricconstexpr bool operator==(const weekday& x, const weekday& y) noexcept;
3990b57cec5SDimitry Andricconstexpr weekday operator+(const weekday& x, const days&    y) noexcept;
4000b57cec5SDimitry Andricconstexpr weekday operator+(const days&    x, const weekday& y) noexcept;
4010b57cec5SDimitry Andricconstexpr weekday operator-(const weekday& x, const days&    y) noexcept;
4020b57cec5SDimitry Andricconstexpr days    operator-(const weekday& x, const weekday& y) noexcept;
403bdd1243dSDimitry Andrictemplate<class charT, class traits>
404bdd1243dSDimitry Andric  basic_ostream<charT, traits>&
405bdd1243dSDimitry Andric    operator<<(basic_ostream<charT, traits>& os, const weekday& wd);
4060b57cec5SDimitry Andric
4070b57cec5SDimitry Andric// 25.8.7, class weekday_indexed    // C++20
4080b57cec5SDimitry Andric
4090b57cec5SDimitry Andricclass weekday_indexed;
4100b57cec5SDimitry Andricconstexpr bool operator==(const weekday_indexed& x, const weekday_indexed& y) noexcept;
4110b57cec5SDimitry Andric
412bdd1243dSDimitry Andrictemplate<class charT, class traits>
413bdd1243dSDimitry Andric  basic_ostream<charT, traits>&
414bdd1243dSDimitry Andric    operator<<(basic_ostream<charT, traits>& os, const weekday_indexed& wdi);
415bdd1243dSDimitry Andric
4160b57cec5SDimitry Andric// 25.8.8, class weekday_last    // C++20
4170b57cec5SDimitry Andricclass weekday_last;
4180b57cec5SDimitry Andric
4190b57cec5SDimitry Andricconstexpr bool operator==(const weekday_last& x, const weekday_last& y) noexcept;
4200b57cec5SDimitry Andric
421bdd1243dSDimitry Andrictemplate<class charT, class traits>
422bdd1243dSDimitry Andric  basic_ostream<charT, traits>&
423bdd1243dSDimitry Andric    operator<<(basic_ostream<charT, traits>& os, const weekday_last& wdl);
424bdd1243dSDimitry Andric
4250b57cec5SDimitry Andric// 25.8.9, class month_day    // C++20
4260b57cec5SDimitry Andricclass month_day;
4270b57cec5SDimitry Andric
4280b57cec5SDimitry Andricconstexpr bool operator==(const month_day& x, const month_day& y) noexcept;
429bdd1243dSDimitry Andricconstexpr strong_ordering operator<=>(const month_day& x, const month_day& y) noexcept;
4300b57cec5SDimitry Andric
431bdd1243dSDimitry Andrictemplate<class charT, class traits>
432bdd1243dSDimitry Andric  basic_ostream<charT, traits>&
433bdd1243dSDimitry Andric    operator<<(basic_ostream<charT, traits>& os, const month_day& md);
4340b57cec5SDimitry Andric
4350b57cec5SDimitry Andric// 25.8.10, class month_day_last    // C++20
4360b57cec5SDimitry Andricclass month_day_last;
4370b57cec5SDimitry Andric
4380b57cec5SDimitry Andricconstexpr bool operator==(const month_day_last& x, const month_day_last& y) noexcept;
439bdd1243dSDimitry Andricconstexpr strong_ordering operator<=>(const month_day_last& x, const month_day_last& y) noexcept;
440bdd1243dSDimitry Andric
441bdd1243dSDimitry Andrictemplate<class charT, class traits>
442bdd1243dSDimitry Andric  basic_ostream<charT, traits>&
443bdd1243dSDimitry Andric    operator<<(basic_ostream<charT, traits>& os, const month_day_last& mdl);
4440b57cec5SDimitry Andric
4450b57cec5SDimitry Andric// 25.8.11, class month_weekday    // C++20
4460b57cec5SDimitry Andricclass month_weekday;
4470b57cec5SDimitry Andric
4480b57cec5SDimitry Andricconstexpr bool operator==(const month_weekday& x, const month_weekday& y) noexcept;
4490b57cec5SDimitry Andric
450bdd1243dSDimitry Andrictemplate<class charT, class traits>
451bdd1243dSDimitry Andric  basic_ostream<charT, traits>&
452bdd1243dSDimitry Andric    operator<<(basic_ostream<charT, traits>& os, const month_weekday& mwd);
453bdd1243dSDimitry Andric
4540b57cec5SDimitry Andric// 25.8.12, class month_weekday_last    // C++20
4550b57cec5SDimitry Andricclass month_weekday_last;
4560b57cec5SDimitry Andric
4570b57cec5SDimitry Andricconstexpr bool operator==(const month_weekday_last& x, const month_weekday_last& y) noexcept;
4580b57cec5SDimitry Andric
459bdd1243dSDimitry Andrictemplate<class charT, class traits>
460bdd1243dSDimitry Andric  basic_ostream<charT, traits>&
461bdd1243dSDimitry Andric    operator<<(basic_ostream<charT, traits>& os, const month_weekday_last& mwdl);
462bdd1243dSDimitry Andric
4630b57cec5SDimitry Andric
4640b57cec5SDimitry Andric// 25.8.13, class year_month    // C++20
4650b57cec5SDimitry Andricclass year_month;
4660b57cec5SDimitry Andric
4670b57cec5SDimitry Andricconstexpr bool operator==(const year_month& x, const year_month& y) noexcept;
468bdd1243dSDimitry Andricconstexpr strong_ordering operator<=>(const year_month& x, const year_month& y) noexcept;
4690b57cec5SDimitry Andric
4700b57cec5SDimitry Andricconstexpr year_month operator+(const year_month& ym, const months& dm) noexcept;
4710b57cec5SDimitry Andricconstexpr year_month operator+(const months& dm, const year_month& ym) noexcept;
4720b57cec5SDimitry Andricconstexpr year_month operator-(const year_month& ym, const months& dm) noexcept;
4730b57cec5SDimitry Andricconstexpr months operator-(const year_month& x, const year_month& y) noexcept;
4740b57cec5SDimitry Andricconstexpr year_month operator+(const year_month& ym, const years& dy) noexcept;
4750b57cec5SDimitry Andricconstexpr year_month operator+(const years& dy, const year_month& ym) noexcept;
4760b57cec5SDimitry Andricconstexpr year_month operator-(const year_month& ym, const years& dy) noexcept;
4770b57cec5SDimitry Andric
478bdd1243dSDimitry Andrictemplate<class charT, class traits>
479bdd1243dSDimitry Andric  basic_ostream<charT, traits>&
480bdd1243dSDimitry Andric    operator<<(basic_ostream<charT, traits>& os, const year_month& ym);
481bdd1243dSDimitry Andric
4820b57cec5SDimitry Andric// 25.8.14, class year_month_day class    // C++20
4830b57cec5SDimitry Andricyear_month_day;
4840b57cec5SDimitry Andric
4850b57cec5SDimitry Andricconstexpr bool operator==(const year_month_day& x, const year_month_day& y) noexcept;
486bdd1243dSDimitry Andricconstexpr strong_ordering operator<=>(const year_month_day& x, const year_month_day& y) noexcept;
4870b57cec5SDimitry Andric
4880b57cec5SDimitry Andricconstexpr year_month_day operator+(const year_month_day& ymd, const months& dm) noexcept;
4890b57cec5SDimitry Andricconstexpr year_month_day operator+(const months& dm, const year_month_day& ymd) noexcept;
4900b57cec5SDimitry Andricconstexpr year_month_day operator+(const year_month_day& ymd, const years& dy) noexcept;
4910b57cec5SDimitry Andricconstexpr year_month_day operator+(const years& dy, const year_month_day& ymd) noexcept;
4920b57cec5SDimitry Andricconstexpr year_month_day operator-(const year_month_day& ymd, const months& dm) noexcept;
4930b57cec5SDimitry Andricconstexpr year_month_day operator-(const year_month_day& ymd, const years& dy) noexcept;
4940b57cec5SDimitry Andric
495bdd1243dSDimitry Andrictemplate<class charT, class traits>
496bdd1243dSDimitry Andric  basic_ostream<charT, traits>&
497bdd1243dSDimitry Andric    operator<<(basic_ostream<charT, traits>& os, const year_month_day& ymd);
4980b57cec5SDimitry Andric
4990b57cec5SDimitry Andric// 25.8.15, class year_month_day_last    // C++20
5000b57cec5SDimitry Andricclass year_month_day_last;
5010b57cec5SDimitry Andric
502bdd1243dSDimitry Andricconstexpr bool operator==(const year_month_day_last& x, const year_month_day_last& y) noexcept;
503bdd1243dSDimitry Andricconstexpr strong_ordering operator<=>(const year_month_day_last_day& x, const year_month_day_last_day& y) noexcept;
5040b57cec5SDimitry Andric
5050b57cec5SDimitry Andricconstexpr year_month_day_last
5060b57cec5SDimitry Andric  operator+(const year_month_day_last& ymdl, const months& dm) noexcept;
5070b57cec5SDimitry Andricconstexpr year_month_day_last
5080b57cec5SDimitry Andric  operator+(const months& dm, const year_month_day_last& ymdl) noexcept;
5090b57cec5SDimitry Andricconstexpr year_month_day_last
5100b57cec5SDimitry Andric  operator+(const year_month_day_last& ymdl, const years& dy) noexcept;
5110b57cec5SDimitry Andricconstexpr year_month_day_last
5120b57cec5SDimitry Andric  operator+(const years& dy, const year_month_day_last& ymdl) noexcept;
5130b57cec5SDimitry Andricconstexpr year_month_day_last
5140b57cec5SDimitry Andric  operator-(const year_month_day_last& ymdl, const months& dm) noexcept;
5150b57cec5SDimitry Andricconstexpr year_month_day_last
5160b57cec5SDimitry Andric  operator-(const year_month_day_last& ymdl, const years& dy) noexcept;
5170b57cec5SDimitry Andric
518bdd1243dSDimitry Andrictemplate<class charT, class traits>
519bdd1243dSDimitry Andric  basic_ostream<charT, traits>&
520bdd1243dSDimitry Andric    operator<<(basic_ostream<charT, traits>& os, const year_month_day_last& ymdl);
521bdd1243dSDimitry Andric
5220b57cec5SDimitry Andric// 25.8.16, class year_month_weekday    // C++20
5230b57cec5SDimitry Andricclass year_month_weekday;
5240b57cec5SDimitry Andric
5250b57cec5SDimitry Andricconstexpr bool operator==(const year_month_weekday& x,
5260b57cec5SDimitry Andric                          const year_month_weekday& y) noexcept;
5270b57cec5SDimitry Andric
5280b57cec5SDimitry Andricconstexpr year_month_weekday
5290b57cec5SDimitry Andric  operator+(const year_month_weekday& ymwd, const months& dm) noexcept;
5300b57cec5SDimitry Andricconstexpr year_month_weekday
5310b57cec5SDimitry Andric  operator+(const months& dm, const year_month_weekday& ymwd) noexcept;
5320b57cec5SDimitry Andricconstexpr year_month_weekday
5330b57cec5SDimitry Andric  operator+(const year_month_weekday& ymwd, const years& dy) noexcept;
5340b57cec5SDimitry Andricconstexpr year_month_weekday
5350b57cec5SDimitry Andric  operator+(const years& dy, const year_month_weekday& ymwd) noexcept;
5360b57cec5SDimitry Andricconstexpr year_month_weekday
5370b57cec5SDimitry Andric  operator-(const year_month_weekday& ymwd, const months& dm) noexcept;
5380b57cec5SDimitry Andricconstexpr year_month_weekday
5390b57cec5SDimitry Andric  operator-(const year_month_weekday& ymwd, const years& dy) noexcept;
5400b57cec5SDimitry Andric
541bdd1243dSDimitry Andrictemplate<class charT, class traits>
542bdd1243dSDimitry Andric  basic_ostream<charT, traits>&
543bdd1243dSDimitry Andric    operator<<(basic_ostream<charT, traits>& os, const year_month_weekday& ymwd);
544bdd1243dSDimitry Andric
5450b57cec5SDimitry Andric// 25.8.17, class year_month_weekday_last    // C++20
5460b57cec5SDimitry Andricclass year_month_weekday_last;
5470b57cec5SDimitry Andric
5480b57cec5SDimitry Andricconstexpr bool operator==(const year_month_weekday_last& x,
5490b57cec5SDimitry Andric                          const year_month_weekday_last& y) noexcept;
5500b57cec5SDimitry Andricconstexpr year_month_weekday_last
5510b57cec5SDimitry Andric  operator+(const year_month_weekday_last& ymwdl, const months& dm) noexcept;
5520b57cec5SDimitry Andricconstexpr year_month_weekday_last
5530b57cec5SDimitry Andric  operator+(const months& dm, const year_month_weekday_last& ymwdl) noexcept;
5540b57cec5SDimitry Andricconstexpr year_month_weekday_last
5550b57cec5SDimitry Andric  operator+(const year_month_weekday_last& ymwdl, const years& dy) noexcept;
5560b57cec5SDimitry Andricconstexpr year_month_weekday_last
5570b57cec5SDimitry Andric  operator+(const years& dy, const year_month_weekday_last& ymwdl) noexcept;
5580b57cec5SDimitry Andricconstexpr year_month_weekday_last
5590b57cec5SDimitry Andric  operator-(const year_month_weekday_last& ymwdl, const months& dm) noexcept;
5600b57cec5SDimitry Andricconstexpr year_month_weekday_last
5610b57cec5SDimitry Andric  operator-(const year_month_weekday_last& ymwdl, const years& dy) noexcept;
5620b57cec5SDimitry Andric
563bdd1243dSDimitry Andrictemplate<class charT, class traits>
564bdd1243dSDimitry Andric  basic_ostream<charT, traits>&
565bdd1243dSDimitry Andric    operator<<(basic_ostream<charT, traits>& os, const year_month_weekday_last& ymwdl);
566bdd1243dSDimitry Andric
5670b57cec5SDimitry Andric// 25.8.18, civil calendar conventional syntax operators    // C++20
5680b57cec5SDimitry Andricconstexpr year_month
5690b57cec5SDimitry Andric  operator/(const year& y, const month& m) noexcept;
5700b57cec5SDimitry Andricconstexpr year_month
5710b57cec5SDimitry Andric  operator/(const year& y, int m) noexcept;
5720b57cec5SDimitry Andricconstexpr month_day
5730b57cec5SDimitry Andric  operator/(const month& m, const day& d) noexcept;
5740b57cec5SDimitry Andricconstexpr month_day
5750b57cec5SDimitry Andric  operator/(const month& m, int d) noexcept;
5760b57cec5SDimitry Andricconstexpr month_day
5770b57cec5SDimitry Andric  operator/(int m, const day& d) noexcept;
5780b57cec5SDimitry Andricconstexpr month_day
5790b57cec5SDimitry Andric  operator/(const day& d, const month& m) noexcept;
5800b57cec5SDimitry Andricconstexpr month_day
5810b57cec5SDimitry Andric  operator/(const day& d, int m) noexcept;
5820b57cec5SDimitry Andricconstexpr month_day_last
5830b57cec5SDimitry Andric  operator/(const month& m, last_spec) noexcept;
5840b57cec5SDimitry Andricconstexpr month_day_last
5850b57cec5SDimitry Andric  operator/(int m, last_spec) noexcept;
5860b57cec5SDimitry Andricconstexpr month_day_last
5870b57cec5SDimitry Andric  operator/(last_spec, const month& m) noexcept;
5880b57cec5SDimitry Andricconstexpr month_day_last
5890b57cec5SDimitry Andric  operator/(last_spec, int m) noexcept;
5900b57cec5SDimitry Andricconstexpr month_weekday
5910b57cec5SDimitry Andric  operator/(const month& m, const weekday_indexed& wdi) noexcept;
5920b57cec5SDimitry Andricconstexpr month_weekday
5930b57cec5SDimitry Andric  operator/(int m, const weekday_indexed& wdi) noexcept;
5940b57cec5SDimitry Andricconstexpr month_weekday
5950b57cec5SDimitry Andric  operator/(const weekday_indexed& wdi, const month& m) noexcept;
5960b57cec5SDimitry Andricconstexpr month_weekday
5970b57cec5SDimitry Andric  operator/(const weekday_indexed& wdi, int m) noexcept;
5980b57cec5SDimitry Andricconstexpr month_weekday_last
5990b57cec5SDimitry Andric  operator/(const month& m, const weekday_last& wdl) noexcept;
6000b57cec5SDimitry Andricconstexpr month_weekday_last
6010b57cec5SDimitry Andric  operator/(int m, const weekday_last& wdl) noexcept;
6020b57cec5SDimitry Andricconstexpr month_weekday_last
6030b57cec5SDimitry Andric  operator/(const weekday_last& wdl, const month& m) noexcept;
6040b57cec5SDimitry Andricconstexpr month_weekday_last
6050b57cec5SDimitry Andric  operator/(const weekday_last& wdl, int m) noexcept;
6060b57cec5SDimitry Andricconstexpr year_month_day
6070b57cec5SDimitry Andric  operator/(const year_month& ym, const day& d) noexcept;
6080b57cec5SDimitry Andricconstexpr year_month_day
6090b57cec5SDimitry Andric  operator/(const year_month& ym, int d) noexcept;
6100b57cec5SDimitry Andricconstexpr year_month_day
6110b57cec5SDimitry Andric  operator/(const year& y, const month_day& md) noexcept;
6120b57cec5SDimitry Andricconstexpr year_month_day
6130b57cec5SDimitry Andric  operator/(int y, const month_day& md) noexcept;
6140b57cec5SDimitry Andricconstexpr year_month_day
6150b57cec5SDimitry Andric  operator/(const month_day& md, const year& y) noexcept;
6160b57cec5SDimitry Andricconstexpr year_month_day
6170b57cec5SDimitry Andric  operator/(const month_day& md, int y) noexcept;
6180b57cec5SDimitry Andricconstexpr year_month_day_last
6190b57cec5SDimitry Andric  operator/(const year_month& ym, last_spec) noexcept;
6200b57cec5SDimitry Andricconstexpr year_month_day_last
6210b57cec5SDimitry Andric  operator/(const year& y, const month_day_last& mdl) noexcept;
6220b57cec5SDimitry Andricconstexpr year_month_day_last
6230b57cec5SDimitry Andric  operator/(int y, const month_day_last& mdl) noexcept;
6240b57cec5SDimitry Andricconstexpr year_month_day_last
6250b57cec5SDimitry Andric  operator/(const month_day_last& mdl, const year& y) noexcept;
6260b57cec5SDimitry Andricconstexpr year_month_day_last
6270b57cec5SDimitry Andric  operator/(const month_day_last& mdl, int y) noexcept;
6280b57cec5SDimitry Andricconstexpr year_month_weekday
6290b57cec5SDimitry Andric  operator/(const year_month& ym, const weekday_indexed& wdi) noexcept;
6300b57cec5SDimitry Andricconstexpr year_month_weekday
6310b57cec5SDimitry Andric  operator/(const year& y, const month_weekday& mwd) noexcept;
6320b57cec5SDimitry Andricconstexpr year_month_weekday
6330b57cec5SDimitry Andric  operator/(int y, const month_weekday& mwd) noexcept;
6340b57cec5SDimitry Andricconstexpr year_month_weekday
6350b57cec5SDimitry Andric  operator/(const month_weekday& mwd, const year& y) noexcept;
6360b57cec5SDimitry Andricconstexpr year_month_weekday
6370b57cec5SDimitry Andric  operator/(const month_weekday& mwd, int y) noexcept;
6380b57cec5SDimitry Andricconstexpr year_month_weekday_last
6390b57cec5SDimitry Andric  operator/(const year_month& ym, const weekday_last& wdl) noexcept;
6400b57cec5SDimitry Andricconstexpr year_month_weekday_last
6410b57cec5SDimitry Andric  operator/(const year& y, const month_weekday_last& mwdl) noexcept;
6420b57cec5SDimitry Andricconstexpr year_month_weekday_last
6430b57cec5SDimitry Andric  operator/(int y, const month_weekday_last& mwdl) noexcept;
6440b57cec5SDimitry Andricconstexpr year_month_weekday_last
6450b57cec5SDimitry Andric  operator/(const month_weekday_last& mwdl, const year& y) noexcept;
6460b57cec5SDimitry Andricconstexpr year_month_weekday_last
6470b57cec5SDimitry Andric  operator/(const month_weekday_last& mwdl, int y) noexcept;
6480b57cec5SDimitry Andric
649e40139ffSDimitry Andric// 26.9, class template hh_mm_ss
650e40139ffSDimitry Andrictemplate <class Duration>
651e40139ffSDimitry Andricclass hh_mm_ss
652e40139ffSDimitry Andric{
653e40139ffSDimitry Andric    bool            is_neg; // exposition only
654e40139ffSDimitry Andric    chrono::hours   h;      // exposition only
655e40139ffSDimitry Andric    chrono::minutes m;      // exposition only
656e40139ffSDimitry Andric    chrono::seconds s;      // exposition only
657e40139ffSDimitry Andric    precision       ss;     // exposition only
6580b57cec5SDimitry Andric
659e40139ffSDimitry Andricpublic:
660e40139ffSDimitry Andric    static unsigned constexpr fractional_width = see below;
661e40139ffSDimitry Andric    using precision                            = see below;
662e40139ffSDimitry Andric
663e40139ffSDimitry Andric    constexpr hh_mm_ss() noexcept : hh_mm_ss{Duration::zero()} {}
664e40139ffSDimitry Andric    constexpr explicit hh_mm_ss(Duration d) noexcept;
665e40139ffSDimitry Andric
666e40139ffSDimitry Andric    constexpr bool is_negative() const noexcept;
667e40139ffSDimitry Andric    constexpr chrono::hours hours() const noexcept;
668e40139ffSDimitry Andric    constexpr chrono::minutes minutes() const noexcept;
669e40139ffSDimitry Andric    constexpr chrono::seconds seconds() const noexcept;
670e40139ffSDimitry Andric    constexpr precision subseconds() const noexcept;
671e40139ffSDimitry Andric
672e40139ffSDimitry Andric    constexpr explicit operator  precision()   const noexcept;
673e40139ffSDimitry Andric    constexpr          precision to_duration() const noexcept;
674e40139ffSDimitry Andric};
675e40139ffSDimitry Andric
67606c3fb27SDimitry Andrictemplate<class charT, class traits, class Duration>
67706c3fb27SDimitry Andric  basic_ostream<charT, traits>&
67806c3fb27SDimitry Andric    operator<<(basic_ostream<charT, traits>& os, const hh_mm_ss<Duration>& hms); // C++20
67906c3fb27SDimitry Andric
680e40139ffSDimitry Andric// 26.10, 12/24 hour functions
681e40139ffSDimitry Andricconstexpr bool is_am(hours const& h) noexcept;
682e40139ffSDimitry Andricconstexpr bool is_pm(hours const& h) noexcept;
683e40139ffSDimitry Andricconstexpr hours make12(const hours& h) noexcept;
684e40139ffSDimitry Andricconstexpr hours make24(const hours& h, bool is_pm) noexcept;
685e40139ffSDimitry Andric
6865f757f3fSDimitry Andric// [time.zone.db], time zone database
6875f757f3fSDimitry Andricstruct tzdb {                                                                    // C++20
6885f757f3fSDimitry Andric  string                 version;
6890fca6ea1SDimitry Andric  vector<time_zone>      zones;
6900fca6ea1SDimitry Andric  vector<time_zone_link> links;
6910fca6ea1SDimitry Andric  vector<leap_second>    leap_seconds;
6920fca6ea1SDimitry Andric
6930fca6ea1SDimitry Andric  const time_zone* locate_zone(string_view tz_name) const;
6940fca6ea1SDimitry Andric  const time_zone* current_zone() const;
6955f757f3fSDimitry Andric};
6965f757f3fSDimitry Andric
6975f757f3fSDimitry Andricclass tzdb_list {                                                                // C++20
6985f757f3fSDimitry Andricpublic:
6995f757f3fSDimitry Andric  tzdb_list(const tzdb_list&) = delete;
7005f757f3fSDimitry Andric  tzdb_list& operator=(const tzdb_list&) = delete;
7015f757f3fSDimitry Andric
7025f757f3fSDimitry Andric  // unspecified additional constructors
7035f757f3fSDimitry Andric
7045f757f3fSDimitry Andric  class const_iterator;
7055f757f3fSDimitry Andric
7065f757f3fSDimitry Andric  const tzdb& front() const noexcept;
7075f757f3fSDimitry Andric
7085f757f3fSDimitry Andric  const_iterator erase_after(const_iterator p);
7095f757f3fSDimitry Andric
7105f757f3fSDimitry Andric  const_iterator begin() const noexcept;
7115f757f3fSDimitry Andric  const_iterator end()   const noexcept;
7125f757f3fSDimitry Andric
7135f757f3fSDimitry Andric  const_iterator cbegin() const noexcept;
7145f757f3fSDimitry Andric  const_iterator cend()   const noexcept;
7155f757f3fSDimitry Andric};
7165f757f3fSDimitry Andric
7175f757f3fSDimitry Andric// [time.zone.db.access], time zone database access
7185f757f3fSDimitry Andricconst tzdb& get_tzdb();                                                          // C++20
7195f757f3fSDimitry Andrictzdb_list& get_tzdb_list();                                                      // C++20
7200fca6ea1SDimitry Andricconst time_zone* locate_zone(string_view tz_name);                               // C++20
7210fca6ea1SDimitry Andricconst time_zone* current_zone()                                                  // C++20
7225f757f3fSDimitry Andric
7235f757f3fSDimitry Andric// [time.zone.db.remote], remote time zone database support
7245f757f3fSDimitry Andricconst tzdb& reload_tzdb();                                                       // C++20
7255f757f3fSDimitry Andricstring remote_version();                                                         // C++20
7265f757f3fSDimitry Andric
7270fca6ea1SDimitry Andric// [time.zone.exception], exception classes
7280fca6ea1SDimitry Andricclass nonexistent_local_time;                                                    // C++20
7290fca6ea1SDimitry Andricclass ambiguous_local_time;                                                      // C++20
7300fca6ea1SDimitry Andric
7310fca6ea1SDimitry Andric// [time.zone.info], information classes
7320fca6ea1SDimitry Andricstruct sys_info {                                                                // C++20
7330fca6ea1SDimitry Andric  sys_seconds   begin;
7340fca6ea1SDimitry Andric  sys_seconds   end;
7350fca6ea1SDimitry Andric  seconds       offset;
7360fca6ea1SDimitry Andric  minutes       save;
7370fca6ea1SDimitry Andric  string        abbrev;
7380fca6ea1SDimitry Andric};
7390fca6ea1SDimitry Andric
7400fca6ea1SDimitry Andrictemplate<class charT, class traits>                                              // C++20
7410fca6ea1SDimitry Andric  basic_ostream<charT, traits>&
7420fca6ea1SDimitry Andric    operator<<(basic_ostream<charT, traits>& os, const sys_info& si);
7430fca6ea1SDimitry Andric
7440fca6ea1SDimitry Andricstruct local_info {                                                             // C++20
7450fca6ea1SDimitry Andric  static constexpr int unique      = 0;
7460fca6ea1SDimitry Andric  static constexpr int nonexistent = 1;
7470fca6ea1SDimitry Andric  static constexpr int ambiguous   = 2;
7480fca6ea1SDimitry Andric
7490fca6ea1SDimitry Andric  int result;
7500fca6ea1SDimitry Andric  sys_info first;
7510fca6ea1SDimitry Andric  sys_info second;
7520fca6ea1SDimitry Andric};
7530fca6ea1SDimitry Andric
7540fca6ea1SDimitry Andrictemplate<class charT, class traits>                                              // C++20
7550fca6ea1SDimitry Andric  basic_ostream<charT, traits>&
7560fca6ea1SDimitry Andric    operator<<(basic_ostream<charT, traits>& os, const local_info& li);
7570fca6ea1SDimitry Andric
7580b57cec5SDimitry Andric// 25.10.5, class time_zone                                                      // C++20
7590b57cec5SDimitry Andricenum class choose {earliest, latest};
7600fca6ea1SDimitry Andricclass time_zone {
7610fca6ea1SDimitry Andric  time_zone(time_zone&&) = default;
7620fca6ea1SDimitry Andric  time_zone& operator=(time_zone&&) = default;
7630fca6ea1SDimitry Andric
7640fca6ea1SDimitry Andric  // unspecified additional constructors
7650fca6ea1SDimitry Andric
7660fca6ea1SDimitry Andric  string_view name() const noexcept;
7670fca6ea1SDimitry Andric
7680fca6ea1SDimitry Andric  template<class Duration>
7690fca6ea1SDimitry Andric  sys_info get_info(const sys_time<Duration>& st) const;
7700fca6ea1SDimitry Andric
7710fca6ea1SDimitry Andric  template<class Duration>
7720fca6ea1SDimitry Andric  local_info get_info(const local_time<Duration>& tp) const;
7730fca6ea1SDimitry Andric
7740fca6ea1SDimitry Andric  template<class Duration>
7750fca6ea1SDimitry Andric  sys_time<common_type_t<Duration, seconds>>
7760fca6ea1SDimitry Andric    to_sys(const local_time<Duration>& tp) const;
7770fca6ea1SDimitry Andric
7780fca6ea1SDimitry Andric  template<class Duration>
7790fca6ea1SDimitry Andric  sys_time<common_type_t<Duration, seconds>>
7800fca6ea1SDimitry Andric    to_sys(const local_time<Duration>& tp, choose z) const;
7810fca6ea1SDimitry Andric
7820fca6ea1SDimitry Andric  template<class Duration>
7830fca6ea1SDimitry Andric  local_time<common_type_t<Duration, seconds>>
7840fca6ea1SDimitry Andric    to_local(const sys_time<Duration>& tp) const;
7850fca6ea1SDimitry Andric};
7860fca6ea1SDimitry Andricbool operator==(const time_zone& x, const time_zone& y) noexcept;                // C++20
7870fca6ea1SDimitry Andricstrong_ordering operator<=>(const time_zone& x, const time_zone& y) noexcept;    // C++20
7880fca6ea1SDimitry Andric
7890fca6ea1SDimitry Andric// [time.zone.zonedtraits], class template zoned_traits
7900fca6ea1SDimitry Andrictemplate<class T> struct zoned_traits;                                           // C++20
7910fca6ea1SDimitry Andric
7920fca6ea1SDimitry Andric// [time.zone.zonedtime], class template zoned_time
7930fca6ea1SDimitry Andrictemplate<class Duration, class TimeZonePtr = const time_zone*>                   // C++20
7940fca6ea1SDimitry Andricclass zoned_time;
7950fca6ea1SDimitry Andric
7960fca6ea1SDimitry Andricusing zoned_seconds = zoned_time<seconds>;                                       // C++20
7970fca6ea1SDimitry Andric
7980fca6ea1SDimitry Andrictemplate<class Duration1, class Duration2, class TimeZonePtr>                    // C++20
7990fca6ea1SDimitry Andric  bool operator==(const zoned_time<Duration1, TimeZonePtr>& x,
8000fca6ea1SDimitry Andric                  const zoned_time<Duration2, TimeZonePtr>& y);
8010fca6ea1SDimitry Andric
8020fca6ea1SDimitry Andrictemplate<class charT, class traits, class Duration, class TimeZonePtr>           // C++20
8030fca6ea1SDimitry Andric  basic_ostream<charT, traits>&
8040fca6ea1SDimitry Andric    operator<<(basic_ostream<charT, traits>& os,
8050fca6ea1SDimitry Andric               const zoned_time<Duration, TimeZonePtr>& t);
8060fca6ea1SDimitry Andric
8070fca6ea1SDimitry Andric// [time.zone.leap], leap second support
8080fca6ea1SDimitry Andricclass leap_second {                                                              // C++20
8090fca6ea1SDimitry Andricpublic:
8100fca6ea1SDimitry Andric  leap_second(const leap_second&)            = default;
8110fca6ea1SDimitry Andric  leap_second& operator=(const leap_second&) = default;
8120fca6ea1SDimitry Andric
8130fca6ea1SDimitry Andric  // unspecified additional constructors
8140fca6ea1SDimitry Andric
8150fca6ea1SDimitry Andric  constexpr sys_seconds date() const noexcept;
8160fca6ea1SDimitry Andric  constexpr seconds value() const noexcept;
8170fca6ea1SDimitry Andric};
8180fca6ea1SDimitry Andric
8190fca6ea1SDimitry Andricconstexpr bool operator==(const leap_second& x, const leap_second& y);           // C++20
8200fca6ea1SDimitry Andricconstexpr strong_ordering operator<=>(const leap_second& x, const leap_second& y);
8210fca6ea1SDimitry Andric
8220fca6ea1SDimitry Andrictemplate<class Duration>                                                         // C++20
8230fca6ea1SDimitry Andric  constexpr bool operator==(const leap_second& x, const sys_time<Duration>& y);
8240fca6ea1SDimitry Andrictemplate<class Duration>                                                         // C++20
8250fca6ea1SDimitry Andric  constexpr bool operator< (const leap_second& x, const sys_time<Duration>& y);
8260fca6ea1SDimitry Andrictemplate<class Duration>                                                         // C++20
8270fca6ea1SDimitry Andric  constexpr bool operator< (const sys_time<Duration>& x, const leap_second& y);
8280fca6ea1SDimitry Andrictemplate<class Duration>                                                         // C++20
8290fca6ea1SDimitry Andric  constexpr bool operator> (const leap_second& x, const sys_time<Duration>& y);
8300fca6ea1SDimitry Andrictemplate<class Duration>                                                         // C++20
8310fca6ea1SDimitry Andric  constexpr bool operator> (const sys_time<Duration>& x, const leap_second& y);
8320fca6ea1SDimitry Andrictemplate<class Duration>                                                         // C++20
8330fca6ea1SDimitry Andric  constexpr bool operator<=(const leap_second& x, const sys_time<Duration>& y);
8340fca6ea1SDimitry Andrictemplate<class Duration>                                                         // C++20
8350fca6ea1SDimitry Andric  constexpr bool operator<=(const sys_time<Duration>& x, const leap_second& y);
8360fca6ea1SDimitry Andrictemplate<class Duration>                                                         // C++20
8370fca6ea1SDimitry Andric  constexpr bool operator>=(const leap_second& x, const sys_time<Duration>& y);
8380fca6ea1SDimitry Andrictemplate<class Duration>                                                         // C++20
8390fca6ea1SDimitry Andric  constexpr bool operator>=(const sys_time<Duration>& x, const leap_second& y);
8400fca6ea1SDimitry Andrictemplate<class Duration>                                                         // C++20
8410fca6ea1SDimitry Andric  requires three_way_comparable_with<sys_seconds, sys_time<Duration>>
8420fca6ea1SDimitry Andric  constexpr auto operator<=>(const leap_second& x, const sys_time<Duration>& y);
8430fca6ea1SDimitry Andric
8440fca6ea1SDimitry Andric// [time.zone.link], class time_zone_link
8450fca6ea1SDimitry Andricclass time_zone_link {                                                           // C++20
8460fca6ea1SDimitry Andricpublic:
8470fca6ea1SDimitry Andric  time_zone_link(time_zone_link&&)            = default;
8480fca6ea1SDimitry Andric  time_zone_link& operator=(time_zone_link&&) = default;
8490fca6ea1SDimitry Andric
8500fca6ea1SDimitry Andric  // unspecified additional constructors
8510fca6ea1SDimitry Andric
8520fca6ea1SDimitry Andric  string_view name()   const noexcept;
8530fca6ea1SDimitry Andric  string_view target() const noexcept;
8540fca6ea1SDimitry Andric};
8550fca6ea1SDimitry Andric
8560fca6ea1SDimitry Andricbool operator==(const time_zone_link& x, const time_zone_link& y);               // C++20
8570fca6ea1SDimitry Andricstrong_ordering operator<=>(const time_zone_link& x, const time_zone_link& y);   // C++20
8580fca6ea1SDimitry Andric
859bdd1243dSDimitry Andric}  // chrono
8600b57cec5SDimitry Andric
861bdd1243dSDimitry Andricnamespace std {
86206c3fb27SDimitry Andric  template<class Duration, class charT>
86306c3fb27SDimitry Andric    struct formatter<chrono::sys_time<Duration>, charT>;                          // C++20
86406c3fb27SDimitry Andric  template<class Duration, class charT>
86506c3fb27SDimitry Andric    struct formatter<chrono::filetime<Duration>, charT>;                          // C++20
86606c3fb27SDimitry Andric  template<class Duration, class charT>
86706c3fb27SDimitry Andric    struct formatter<chrono::local_time<Duration>, charT>;                        // C++20
868bdd1243dSDimitry Andric  template<class Rep, class Period, class charT>
869bdd1243dSDimitry Andric    struct formatter<chrono::duration<Rep, Period>, charT>;                       // C++20
870bdd1243dSDimitry Andric  template<class charT> struct formatter<chrono::day, charT>;                     // C++20
871bdd1243dSDimitry Andric  template<class charT> struct formatter<chrono::month, charT>;                   // C++20
872bdd1243dSDimitry Andric  template<class charT> struct formatter<chrono::year, charT>;                    // C++20
873bdd1243dSDimitry Andric  template<class charT> struct formatter<chrono::weekday, charT>;                 // C++20
874bdd1243dSDimitry Andric  template<class charT> struct formatter<chrono::weekday_indexed, charT>;         // C++20
875bdd1243dSDimitry Andric  template<class charT> struct formatter<chrono::weekday_last, charT>;            // C++20
876bdd1243dSDimitry Andric  template<class charT> struct formatter<chrono::month_day, charT>;               // C++20
877bdd1243dSDimitry Andric  template<class charT> struct formatter<chrono::month_day_last, charT>;          // C++20
878bdd1243dSDimitry Andric  template<class charT> struct formatter<chrono::month_weekday, charT>;           // C++20
879bdd1243dSDimitry Andric  template<class charT> struct formatter<chrono::month_weekday_last, charT>;      // C++20
880bdd1243dSDimitry Andric  template<class charT> struct formatter<chrono::year_month, charT>;              // C++20
881bdd1243dSDimitry Andric  template<class charT> struct formatter<chrono::year_month_day, charT>;          // C++20
882bdd1243dSDimitry Andric  template<class charT> struct formatter<chrono::year_month_day_last, charT>;     // C++20
883bdd1243dSDimitry Andric  template<class charT> struct formatter<chrono::year_month_weekday, charT>;      // C++20
884bdd1243dSDimitry Andric  template<class charT> struct formatter<chrono::year_month_weekday_last, charT>; // C++20
88506c3fb27SDimitry Andric  template<class Rep, class Period, class charT>
88606c3fb27SDimitry Andric    struct formatter<chrono::hh_mm_ss<duration<Rep, Period>>, charT>;             // C++20
8870fca6ea1SDimitry Andric  template<class charT> struct formatter<chrono::sys_info, charT>;                // C++20
8880fca6ea1SDimitry Andric  template<class charT> struct formatter<chrono::local_info, charT>;              // C++20
8890fca6ea1SDimitry Andric  template<class Duration, class TimeZonePtr, class charT>                        // C++20
8900fca6ea1SDimitry Andric    struct formatter<chrono::zoned_time<Duration, TimeZonePtr>, charT>;
891bdd1243dSDimitry Andric} // namespace std
892bdd1243dSDimitry Andric
893bdd1243dSDimitry Andricnamespace chrono {
8940b57cec5SDimitry Andric// calendrical constants
8950b57cec5SDimitry Andricinline constexpr last_spec                              last{};       // C++20
8960b57cec5SDimitry Andricinline constexpr chrono::weekday                        Sunday{0};    // C++20
8970b57cec5SDimitry Andricinline constexpr chrono::weekday                        Monday{1};    // C++20
8980b57cec5SDimitry Andricinline constexpr chrono::weekday                        Tuesday{2};   // C++20
8990b57cec5SDimitry Andricinline constexpr chrono::weekday                        Wednesday{3}; // C++20
9000b57cec5SDimitry Andricinline constexpr chrono::weekday                        Thursday{4};  // C++20
9010b57cec5SDimitry Andricinline constexpr chrono::weekday                        Friday{5};    // C++20
9020b57cec5SDimitry Andricinline constexpr chrono::weekday                        Saturday{6};  // C++20
9030b57cec5SDimitry Andric
9040b57cec5SDimitry Andricinline constexpr chrono::month                          January{1};   // C++20
9050b57cec5SDimitry Andricinline constexpr chrono::month                          February{2};  // C++20
9060b57cec5SDimitry Andricinline constexpr chrono::month                          March{3};     // C++20
9070b57cec5SDimitry Andricinline constexpr chrono::month                          April{4};     // C++20
9080b57cec5SDimitry Andricinline constexpr chrono::month                          May{5};       // C++20
9090b57cec5SDimitry Andricinline constexpr chrono::month                          June{6};      // C++20
9100b57cec5SDimitry Andricinline constexpr chrono::month                          July{7};      // C++20
9110b57cec5SDimitry Andricinline constexpr chrono::month                          August{8};    // C++20
9120b57cec5SDimitry Andricinline constexpr chrono::month                          September{9}; // C++20
9130b57cec5SDimitry Andricinline constexpr chrono::month                          October{10};  // C++20
9140b57cec5SDimitry Andricinline constexpr chrono::month                          November{11}; // C++20
9150b57cec5SDimitry Andricinline constexpr chrono::month                          December{12}; // C++20
9160b57cec5SDimitry Andric}  // chrono
9170b57cec5SDimitry Andric
9180b57cec5SDimitry Andricinline namespace literals {
9190b57cec5SDimitry Andric  inline namespace chrono_literals {
9200b57cec5SDimitry Andricconstexpr chrono::hours                                 operator ""h(unsigned long long); // C++14
9210b57cec5SDimitry Andricconstexpr chrono::duration<unspecified , ratio<3600,1>> operator ""h(long double); // C++14
9220b57cec5SDimitry Andricconstexpr chrono::minutes                               operator ""min(unsigned long long); // C++14
9230b57cec5SDimitry Andricconstexpr chrono::duration<unspecified , ratio<60,1>>   operator ""min(long double); // C++14
9240b57cec5SDimitry Andricconstexpr chrono::seconds                               operator ""s(unsigned long long); // C++14
9250b57cec5SDimitry Andricconstexpr chrono::duration<unspecified >                operator ""s(long double); // C++14
9260b57cec5SDimitry Andricconstexpr chrono::milliseconds                          operator ""ms(unsigned long long); // C++14
9270b57cec5SDimitry Andricconstexpr chrono::duration<unspecified , milli>         operator ""ms(long double); // C++14
9280b57cec5SDimitry Andricconstexpr chrono::microseconds                          operator ""us(unsigned long long); // C++14
9290b57cec5SDimitry Andricconstexpr chrono::duration<unspecified , micro>         operator ""us(long double); // C++14
9300b57cec5SDimitry Andricconstexpr chrono::nanoseconds                           operator ""ns(unsigned long long); // C++14
9310b57cec5SDimitry Andricconstexpr chrono::duration<unspecified , nano>          operator ""ns(long double); // C++14
9320b57cec5SDimitry Andricconstexpr chrono::day                                   operator ""d(unsigned long long d) noexcept; // C++20
9330b57cec5SDimitry Andricconstexpr chrono::year                                  operator ""y(unsigned long long y) noexcept; // C++20
9340b57cec5SDimitry Andric}  // chrono_literals
9350b57cec5SDimitry Andric}  // literals
9360b57cec5SDimitry Andric
9370b57cec5SDimitry Andric}  // std
9380b57cec5SDimitry Andric*/
9390b57cec5SDimitry Andric
9405f757f3fSDimitry Andric// clang-format on
9415f757f3fSDimitry Andric
9420fca6ea1SDimitry Andric#include <__config>
9430fca6ea1SDimitry Andric
94404eeddc0SDimitry Andric#include <__chrono/duration.h>
94504eeddc0SDimitry Andric#include <__chrono/file_clock.h>
94604eeddc0SDimitry Andric#include <__chrono/high_resolution_clock.h>
94704eeddc0SDimitry Andric#include <__chrono/steady_clock.h>
94804eeddc0SDimitry Andric#include <__chrono/system_clock.h>
94904eeddc0SDimitry Andric#include <__chrono/time_point.h>
9500fca6ea1SDimitry Andric
9510fca6ea1SDimitry Andric#if _LIBCPP_STD_VER >= 20
9520fca6ea1SDimitry Andric#  include <__chrono/calendar.h>
9530fca6ea1SDimitry Andric#  include <__chrono/day.h>
9540fca6ea1SDimitry Andric#  include <__chrono/exception.h>
9550fca6ea1SDimitry Andric#  include <__chrono/hh_mm_ss.h>
9560fca6ea1SDimitry Andric#  include <__chrono/literals.h>
9570fca6ea1SDimitry Andric#  include <__chrono/local_info.h>
9580fca6ea1SDimitry Andric#  include <__chrono/month.h>
9590fca6ea1SDimitry Andric#  include <__chrono/month_weekday.h>
9600fca6ea1SDimitry Andric#  include <__chrono/monthday.h>
9610fca6ea1SDimitry Andric#  include <__chrono/sys_info.h>
96281ad6265SDimitry Andric#  include <__chrono/weekday.h>
96381ad6265SDimitry Andric#  include <__chrono/year.h>
96481ad6265SDimitry Andric#  include <__chrono/year_month.h>
96581ad6265SDimitry Andric#  include <__chrono/year_month_day.h>
96681ad6265SDimitry Andric#  include <__chrono/year_month_weekday.h>
9670b57cec5SDimitry Andric
9680fca6ea1SDimitry Andric#  if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
969bdd1243dSDimitry Andric#    include <__chrono/formatter.h>
970bdd1243dSDimitry Andric#    include <__chrono/ostream.h>
971bdd1243dSDimitry Andric#    include <__chrono/parser_std_format_spec.h>
972bdd1243dSDimitry Andric#    include <__chrono/statically_widen.h>
973bdd1243dSDimitry Andric#  endif
974bdd1243dSDimitry Andric
9755f757f3fSDimitry Andric#  if !defined(_LIBCPP_HAS_NO_TIME_ZONE_DATABASE) && !defined(_LIBCPP_HAS_NO_FILESYSTEM) &&                            \
9765f757f3fSDimitry Andric      !defined(_LIBCPP_HAS_NO_LOCALIZATION)
9770fca6ea1SDimitry Andric#    include <__chrono/leap_second.h>
9780fca6ea1SDimitry Andric#    include <__chrono/time_zone.h>
9790fca6ea1SDimitry Andric#    include <__chrono/time_zone_link.h>
9805f757f3fSDimitry Andric#    include <__chrono/tzdb.h>
9815f757f3fSDimitry Andric#    include <__chrono/tzdb_list.h>
9820fca6ea1SDimitry Andric#    include <__chrono/zoned_time.h>
9835f757f3fSDimitry Andric#  endif
984bdd1243dSDimitry Andric
9850fca6ea1SDimitry Andric#endif
9860fca6ea1SDimitry Andric
9870fca6ea1SDimitry Andric#include <version>
9880fca6ea1SDimitry Andric
9890fca6ea1SDimitry Andric// standard-mandated includes
9900fca6ea1SDimitry Andric
9910fca6ea1SDimitry Andric// [time.syn]
9920fca6ea1SDimitry Andric#include <compare>
9930fca6ea1SDimitry Andric
9940b57cec5SDimitry Andric#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
9950b57cec5SDimitry Andric#  pragma GCC system_header
9960b57cec5SDimitry Andric#endif
9970b57cec5SDimitry Andric
9980fca6ea1SDimitry Andric#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 17
9990fca6ea1SDimitry Andric#  include <cstdint>
10000fca6ea1SDimitry Andric#  include <stdexcept>
10010fca6ea1SDimitry Andric#  include <string_view>
10020fca6ea1SDimitry Andric#  include <vector>
10030fca6ea1SDimitry Andric#endif
10040fca6ea1SDimitry Andric
1005bdd1243dSDimitry Andric#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
100606c3fb27SDimitry Andric#  include <bit>
1007bdd1243dSDimitry Andric#  include <concepts>
100806c3fb27SDimitry Andric#  include <cstring>
10095f757f3fSDimitry Andric#  include <forward_list>
10105f757f3fSDimitry Andric#  include <string>
10110fca6ea1SDimitry Andric#  include <tuple>
101206c3fb27SDimitry Andric#endif
101306c3fb27SDimitry Andric
101406c3fb27SDimitry Andric#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER == 20
101506c3fb27SDimitry Andric#  include <charconv>
10160fca6ea1SDimitry Andric#  if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
10170fca6ea1SDimitry Andric#    include <locale>
10180fca6ea1SDimitry Andric#    include <ostream>
1019bdd1243dSDimitry Andric#  endif
1020*c80e69b0SDimitry Andric#endif
1021bdd1243dSDimitry Andric
10220b57cec5SDimitry Andric#endif // _LIBCPP_CHRONO
1023