Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
fmt
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
fmt
Commits
ac59d9f3
Commit
ac59d9f3
authored
Sep 24, 2019
by
mwinterb
Committed by
Victor Zverovich
Sep 24, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
workaround VS2019 Update 3 compiler bug. (#1328)
parent
8f27ce4d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
include/fmt/safe-duration-cast.h
include/fmt/safe-duration-cast.h
+4
-2
No files found.
include/fmt/safe-duration-cast.h
View file @
ac59d9f3
...
@@ -161,7 +161,8 @@ To safe_duration_cast(std::chrono::duration<FromRep, FromPeriod> from,
...
@@ -161,7 +161,8 @@ To safe_duration_cast(std::chrono::duration<FromRep, FromPeriod> from,
ec
=
0
;
ec
=
0
;
// the basic idea is that we need to convert from count() in the from type
// 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:
// 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
::
num
>
0
,
"num must be positive"
);
static_assert
(
Factor
::
den
>
0
,
"den must be positive"
);
static_assert
(
Factor
::
den
>
0
,
"den must be positive"
);
...
@@ -232,7 +233,8 @@ To safe_duration_cast(std::chrono::duration<FromRep, FromPeriod> from,
...
@@ -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
// 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:
// 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
::
num
>
0
,
"num must be positive"
);
static_assert
(
Factor
::
den
>
0
,
"den must be positive"
);
static_assert
(
Factor
::
den
>
0
,
"den must be positive"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment