Skip to content

Commit

Permalink
workaround VS2019 Update 3 compiler bug. (#1328)
Browse files Browse the repository at this point in the history
  • Loading branch information
mwinterb authored and vitaut committed Sep 24, 2019
1 parent 8f27ce4 commit ac59d9f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions include/fmt/safe-duration-cast.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ To safe_duration_cast(std::chrono::duration<FromRep, FromPeriod> from,
ec = 0;
// the basic idea is that we need to convert from count() in the from type
// to count() in the To type, by multiplying it with this:
using Factor = std::ratio_divide<typename From::period, typename To::period>;
struct Factor
: std::ratio_divide<typename From::period, typename To::period> {};

static_assert(Factor::num > 0, "num must be positive");
static_assert(Factor::den > 0, "den must be positive");
Expand Down Expand Up @@ -232,7 +233,8 @@ To safe_duration_cast(std::chrono::duration<FromRep, FromPeriod> from,

// the basic idea is that we need to convert from count() in the from type
// to count() in the To type, by multiplying it with this:
using Factor = std::ratio_divide<typename From::period, typename To::period>;
struct Factor
: std::ratio_divide<typename From::period, typename To::period> {};

static_assert(Factor::num > 0, "num must be positive");
static_assert(Factor::den > 0, "den must be positive");
Expand Down

0 comments on commit ac59d9f

Please sign in to comment.