Add conditional_t for pre-C++14

This commit is contained in:
Victor Zverovich
2019-06-04 18:50:30 -07:00
parent 4aa0dc578b
commit c264e641ea
6 changed files with 36 additions and 40 deletions
+3 -3
View File
@@ -450,9 +450,9 @@ struct chrono_formatter {
OutputIt out;
int precision;
// rep is unsigned to avoid overflow.
using rep = typename std::conditional<
std::is_integral<Rep>::value && sizeof(Rep) < sizeof(int), unsigned,
typename make_unsigned_or_unchanged<Rep>::type>::type;
using rep =
conditional_t<std::is_integral<Rep>::value && sizeof(Rep) < sizeof(int),
unsigned, typename make_unsigned_or_unchanged<Rep>::type>;
rep val;
typedef std::chrono::duration<rep> seconds;
seconds s;