Work around for a NVCC compiler bug

The NVCC compiler fails to compile the date library due
to a compiler bug which causes it to emit an error when
directly using std::ratio_{multiply,divide} in the template
instantiations for std::duration. This PR works around the
issue by introducing custom ratio_{multiply,divide} which
delegate to the standard library templates
This commit is contained in:
Lakshay Garg
2019-11-29 19:27:36 -05:00
committed by Howard Hinnant
parent 3e376be2e9
commit 018a50bcd0
7 changed files with 33 additions and 22 deletions
+4 -4
View File
@@ -27,12 +27,12 @@
#include <type_traits>
using fortnights = std::chrono::duration<date::weeks::rep,
std::ratio_multiply<std::ratio<2>,
date::weeks::period>>;
date::detail::ratio_multiply<std::ratio<2>,
date::weeks::period>>;
using microfortnights = std::chrono::duration<std::int64_t,
std::ratio_multiply<fortnights::period,
std::micro>>;
date::detail::ratio_multiply<fortnights::period,
std::micro>>;
int
main()