|
942 | 942 | namespace std::chrono {
|
943 | 943 | using namespace literals::chrono_literals;
|
944 | 944 | }
|
| 945 | + |
| 946 | +namespace std { |
| 947 | + // \ref{time.hash}, hash support |
| 948 | + template<class T> struct hash; |
| 949 | + template<class Rep, class Period> struct hash<chrono::duration<Rep, Period>>; |
| 950 | + template<class Clock, class Duration> struct hash<chrono::time_point<Clock, Duration>>; |
| 951 | + template<> struct hash<chrono::day>; |
| 952 | + template<> struct hash<chrono::month>; |
| 953 | + template<> struct hash<chrono::year>; |
| 954 | + template<> struct hash<chrono::weekday>; |
| 955 | + template<> struct hash<chrono::weekday_indexed>; |
| 956 | + template<> struct hash<chrono::weekday_last>; |
| 957 | + template<> struct hash<chrono::month_day>; |
| 958 | + template<> struct hash<chrono::month_day_last>; |
| 959 | + template<> struct hash<chrono::month_weekday>; |
| 960 | + template<> struct hash<chrono::month_weekday_last>; |
| 961 | + template<> struct hash<chrono::year_month>; |
| 962 | + template<> struct hash<chrono::year_month_day>; |
| 963 | + template<> struct hash<chrono::year_month_day_last>; |
| 964 | + template<> struct hash<chrono::year_month_weekday>; |
| 965 | + template<> struct hash<chrono::year_month_weekday_last>; |
| 966 | + template<class Duration, class TimeZonePtr> |
| 967 | + struct hash<chrono::zoned_time<Duration, TimeZonePtr>>; |
| 968 | + template<> struct hash<chrono::leap_second>; |
| 969 | +} |
945 | 970 | \end{codeblock}
|
946 | 971 |
|
947 | 972 | \rSec1[time.clock.req]{\oldconcept{Clock} requirements}
|
@@ -11449,6 +11474,101 @@
|
11449 | 11474 |
|
11450 | 11475 | \indexlibrary{\idxcode{parse}|)}
|
11451 | 11476 |
|
| 11477 | +\rSec1[time.hash]{Hash support} |
| 11478 | + |
| 11479 | +\indexlibrarymember{hash}{duration}% |
| 11480 | +\begin{itemdecl} |
| 11481 | +template<class Rep, class Period> struct hash<chrono::duration<Rep, Period>>; |
| 11482 | +\end{itemdecl} |
| 11483 | + |
| 11484 | +\begin{itemdescr} |
| 11485 | +\pnum |
| 11486 | +The specialization \tcode{hash<chrono::duration<Rep, Period>>} is enabled\iref{unord.hash} |
| 11487 | +if and only if \\% newline to fix overfull hbox |
| 11488 | +\tcode{hash<Rep>} is enabled. |
| 11489 | +The member functions are not guaranteed to be \keyword{noexcept}. |
| 11490 | +\end{itemdescr} |
| 11491 | + |
| 11492 | +\indexlibrarymember{hash}{time_point}% |
| 11493 | +\begin{itemdecl} |
| 11494 | +template<class Clock, class Duration> struct hash<chrono::time_point<Clock, Duration>>; |
| 11495 | +\end{itemdecl} |
| 11496 | + |
| 11497 | +\begin{itemdescr} |
| 11498 | +\pnum |
| 11499 | +The specialization \tcode{hash<chrono::time_point<Clock, Duration>>} is enabled\iref{unord.hash} |
| 11500 | +if and only if \tcode{hash<Duration>} is enabled. |
| 11501 | +The member functions are not guaranteed to be \keyword{noexcept}. |
| 11502 | +\end{itemdescr} |
| 11503 | + |
| 11504 | +\indexlibrarymember{hash}{day}% |
| 11505 | +\indexlibrarymember{hash}{month}% |
| 11506 | +\indexlibrarymember{hash}{year}% |
| 11507 | +\indexlibrarymember{hash}{weekday}% |
| 11508 | +\indexlibrarymember{hash}{weekday_indexed}% |
| 11509 | +\indexlibrarymember{hash}{weekday_last}% |
| 11510 | +\indexlibrarymember{hash}{month_day}% |
| 11511 | +\indexlibrarymember{hash}{month_day_last}% |
| 11512 | +\indexlibrarymember{hash}{month_weekday}% |
| 11513 | +\indexlibrarymember{hash}{month_weekday_last}% |
| 11514 | +\indexlibrarymember{hash}{year_month}% |
| 11515 | +\indexlibrarymember{hash}{year_month_day}% |
| 11516 | +\indexlibrarymember{hash}{year_month_day_last}% |
| 11517 | +\indexlibrarymember{hash}{year_month_weekday}% |
| 11518 | +\indexlibrarymember{hash}{year_month_weekday_last}% |
| 11519 | +\begin{itemdecl} |
| 11520 | +template<> struct hash<chrono::day>; |
| 11521 | +template<> struct hash<chrono::month>; |
| 11522 | +template<> struct hash<chrono::year>; |
| 11523 | +template<> struct hash<chrono::weekday>; |
| 11524 | +template<> struct hash<chrono::weekday_indexed>; |
| 11525 | +template<> struct hash<chrono::weekday_last>; |
| 11526 | +template<> struct hash<chrono::month_day>; |
| 11527 | +template<> struct hash<chrono::month_day_last>; |
| 11528 | +template<> struct hash<chrono::month_weekday>; |
| 11529 | +template<> struct hash<chrono::month_weekday_last>; |
| 11530 | +template<> struct hash<chrono::year_month>; |
| 11531 | +template<> struct hash<chrono::year_month_day>; |
| 11532 | +template<> struct hash<chrono::year_month_day_last>; |
| 11533 | +template<> struct hash<chrono::year_month_weekday>; |
| 11534 | +template<> struct hash<chrono::year_month_weekday_last>; |
| 11535 | +\end{itemdecl} |
| 11536 | + |
| 11537 | +\begin{itemdescr} |
| 11538 | +\pnum |
| 11539 | +The specializations are enabled\iref{unord.hash}. |
| 11540 | +\begin{note} |
| 11541 | +All the \tcode{hash<Key>} specializations listed above meet the |
| 11542 | +\oldconcept{Cpp17Hash} requirements, even when called on objects \tcode{k} |
| 11543 | +of type \tcode{Key} such that \tcode{k.ok()} is \tcode{false}. |
| 11544 | +\end{note} |
| 11545 | +\end{itemdescr} |
| 11546 | + |
| 11547 | +\indexlibrarymember{hash}{zoned_time}% |
| 11548 | +\begin{itemdecl} |
| 11549 | +template<class Duration, class TimeZonePtr> |
| 11550 | + struct hash<chrono::zoned_time<Duration, TimeZonePtr>>; |
| 11551 | +\end{itemdecl} |
| 11552 | + |
| 11553 | +\begin{itemdescr} |
| 11554 | +\pnum |
| 11555 | +The specialization \tcode{hash<chrono::zoned_time<Durationm TimeZonePtr>>} |
| 11556 | +is enabled\iref{unord.hash} |
| 11557 | +if and only if \tcode{hash<Duration>} is enabled and |
| 11558 | +\tcode{hash<TimeZonePtr>} is enabled. |
| 11559 | +The member functions are not guaranteed to be \keyword{noexcept}. |
| 11560 | +\end{itemdescr} |
| 11561 | + |
| 11562 | +\indexlibrarymember{hash}{leap_second}% |
| 11563 | +\begin{itemdecl} |
| 11564 | +template<> struct hash<chrono::leap_second>; |
| 11565 | +\end{itemdecl} |
| 11566 | + |
| 11567 | +\begin{itemdescr} |
| 11568 | +\pnum |
| 11569 | +The specialization is enabled\iref{unord.hash}. |
| 11570 | +\end{itemdescr} |
| 11571 | + |
11452 | 11572 | \rSec1[ctime.syn]{Header \tcode{<ctime>} synopsis}
|
11453 | 11573 |
|
11454 | 11574 | \indexheader{ctime}%
|
|
0 commit comments