Warning, file /include/QtCore/q20chrono.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004 #ifndef Q20CHRONO_H
0005 #define Q20CHRONO_H
0006
0007 #include <QtCore/qtconfigmacros.h>
0008
0009 #include <chrono>
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027 QT_BEGIN_NAMESPACE
0028
0029 namespace q20 {
0030 namespace chrono {
0031
0032 #if defined(__GLIBCXX__)
0033
0034 using IntRep = int64_t;
0035 #else
0036
0037
0038 using IntRep = int;
0039 #endif
0040
0041
0042 #if __cpp_lib_chrono >= 201907L && !defined(Q_OS_INTEGRITY)
0043 using std::chrono::days;
0044 using std::chrono::weeks;
0045 using std::chrono::years;
0046 using std::chrono::months;
0047
0048 static_assert(std::is_same_v<days::rep, IntRep>);
0049 static_assert(std::is_same_v<weeks::rep, IntRep>);
0050 static_assert(std::is_same_v<years::rep, IntRep>);
0051 static_assert(std::is_same_v<months::rep, IntRep>);
0052 #else
0053 using days = std::chrono::duration<IntRep, std::ratio<86400>>;
0054 using weeks = std::chrono::duration<IntRep, std::ratio_multiply<std::ratio<7>, days::period>>;
0055 using years = std::chrono::duration<IntRep, std::ratio_multiply<std::ratio<146097, 400>, days::period>>;
0056 using months = std::chrono::duration<IntRep, std::ratio_divide<years::period, std::ratio<12>>>;
0057 #endif
0058 }
0059 }
0060
0061 QT_END_NAMESPACE
0062
0063 #endif