Skip to content

Commit

Permalink
More chrono compatibility typedefs
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkvdb committed Mar 27, 2024
1 parent 72c99f0 commit b50680c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/infra/chrono.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,22 @@ namespace inf::chrono {

#ifdef HAVE_CPP20_CHRONO
using days = std::chrono::days;
using month = std::chrono::month;
using year = std::chrono::year;
using date_point = std::chrono::time_point<std::chrono::system_clock, days>;
using time_point = std::chrono::time_point<std::chrono::system_clock, std::chrono::milliseconds>;

using local_seconds = std::chrono::local_seconds;
using local_date_point = std::chrono::local_days;
using local_time_point = std::chrono::local_time<std::chrono::milliseconds>;
#else
using days = date::days;
using month = date::month;
using year = date::year;
using date_point = std::chrono::time_point<std::chrono::system_clock, days>;
using time_point = std::chrono::time_point<std::chrono::system_clock, std::chrono::milliseconds>;

using local_seconds = date::local_seconds;
using local_date_point = date::local_days;
using local_time_point = date::local_time<std::chrono::milliseconds>;
#endif
Expand Down

0 comments on commit b50680c

Please sign in to comment.