Update Duration.h
This commit is contained in:
@@ -32,22 +32,6 @@ using Seconds = std::chrono::seconds;
|
||||
/// Minutes shorthand typedef.
|
||||
using Minutes = std::chrono::minutes;
|
||||
|
||||
/// Hours shorthand typedef.
|
||||
using Hours = std::chrono::hours;
|
||||
|
||||
#if __cplusplus > 201703L
|
||||
/// Days shorthand typedef.
|
||||
using Days = std::chrono::days;
|
||||
|
||||
/// Weeks shorthand typedef.
|
||||
using Weeks = std::chrono::weeks;
|
||||
|
||||
/// Years shorthand typedef.
|
||||
using Years = std::chrono::years;
|
||||
|
||||
/// Months shorthand typedef.
|
||||
using Months = std::chrono::months;
|
||||
|
||||
// Fix GCC for C++20
|
||||
#if defined(__GNUC__) && !defined(__clang__)
|
||||
/// days
|
||||
@@ -62,21 +46,24 @@ using Years = std::chrono::duration<_GLIBCXX_CHRONO_INT64_T, ratio<31556952>>;
|
||||
/// months
|
||||
using Months = std::chrono::duration<_GLIBCXX_CHRONO_INT64_T, ratio<2629746>>;
|
||||
|
||||
#endif // GCC_VERSION
|
||||
|
||||
#else
|
||||
/// Days shorthand typedef. (delete after start support c++20)
|
||||
using Days = std::chrono::duration<int, std::ratio_multiply<std::ratio<24>, Hours::period>>;
|
||||
|
||||
/// Weeks shorthand typedef. (delete after start support c++20)
|
||||
using Weeks = std::chrono::duration<int, std::ratio_multiply<std::ratio<7>, Days::period>>;
|
||||
/// Hours shorthand typedef.
|
||||
using Hours = std::chrono::hours;
|
||||
|
||||
/// Years shorthand typedef. (delete after start support c++20)
|
||||
using Years = std::chrono::duration<int, std::ratio_multiply<std::ratio<146097, 400>, Days::period>>;
|
||||
/// Days shorthand typedef.
|
||||
using Days = std::chrono::days;
|
||||
|
||||
/// Months shorthand typedef. (delete after start support c++20)
|
||||
using Months = std::chrono::duration<int, std::ratio_divide<Years::period, std::ratio<12>>>;
|
||||
#endif
|
||||
/// Weeks shorthand typedef.
|
||||
using Weeks = std::chrono::weeks;
|
||||
|
||||
/// Years shorthand typedef.
|
||||
using Years = std::chrono::years;
|
||||
|
||||
/// Months shorthand typedef.
|
||||
using Months = std::chrono::months;
|
||||
|
||||
#endif // GCC_VERSION
|
||||
|
||||
/// time_point shorthand typedefs
|
||||
using TimePoint = std::chrono::steady_clock::time_point;
|
||||
|
||||
Reference in New Issue
Block a user