fix: unit_tests.cpp compilation fixed for MSVC

This commit is contained in:
Mateusz Pusz
2021-01-04 13:55:27 +01:00
parent 6539b492a3
commit 76437a7752

View File

@@ -43,7 +43,9 @@ struct dim_time : base_dimension<"time", second> {};
struct kelvin : named_unit<kelvin, "K", no_prefix> {}; struct kelvin : named_unit<kelvin, "K", no_prefix> {};
#if !COMP_MSVC
static_assert([]<Prefix P>(P) { return !requires { typename prefixed_unit<struct kilokelvin, P, kelvin>; }; }(si::kilo{})); // no prefix allowed static_assert([]<Prefix P>(P) { return !requires { typename prefixed_unit<struct kilokelvin, P, kelvin>; }; }(si::kilo{})); // no prefix allowed
#endif
struct metre_per_second : unit<metre_per_second> {}; struct metre_per_second : unit<metre_per_second> {};
struct dim_speed : derived_dimension<dim_speed, metre_per_second, units::exponent<dim_length, 1>, units::exponent<dim_time, -1>> {}; struct dim_speed : derived_dimension<dim_speed, metre_per_second, units::exponent<dim_length, 1>, units::exponent<dim_time, -1>> {};
@@ -55,7 +57,9 @@ static_assert(compare<downcast<scaled_unit<ratio(yard::ratio.num, yard::ratio.de
static_assert(compare<downcast<scaled_unit<yard::ratio * ratio(1, 3), metre>>, foot>); static_assert(compare<downcast<scaled_unit<yard::ratio * ratio(1, 3), metre>>, foot>);
static_assert(compare<downcast<scaled_unit<kilometre::ratio / hour::ratio, metre_per_second>>, kilometre_per_hour>); static_assert(compare<downcast<scaled_unit<kilometre::ratio / hour::ratio, metre_per_second>>, kilometre_per_hour>);
#if !COMP_MSVC
static_assert([]<ratio R>() { return !requires { typename scaled_unit<R, metre>; }; }.template operator()<ratio(-1, 1)>()); // negative unit ratio static_assert([]<ratio R>() { return !requires { typename scaled_unit<R, metre>; }; }.template operator()<ratio(-1, 1)>()); // negative unit ratio
#endif
static_assert(centimetre::symbol == "cm"); static_assert(centimetre::symbol == "cm");
static_assert(kilometre::symbol == "km"); static_assert(kilometre::symbol == "km");