Remove troublesome ::ratio members
For some reason, MSVC seems to want to instantiate these, even though nobody ever asks for them (as evidenced by the fact that the builds passed on other architectures).
This commit is contained in:
1 parent
7a03692e14
commit
78bcb3b019
11 files changed
+16
-19
No files matched your search
@@ -326,8 +326,9 @@ TEST_CASE("std::format on synthesized unit symbols", "[text][fmt]")
|
||||
|
||||
SECTION("unknown scaled unit with reference different than the dimension's coherent unit")
|
||||
{
|
||||
constexpr auto mag = units::as_magnitude<units::ratio{2, 3}>();
|
||||
CHECK(STD_FMT::format("{}", mass<units::scaled_unit<mag, gram>>(1)) == "1 [2/3 × 10⁻³] kg");
|
||||
CHECK(STD_FMT::format("{:%Q %Aq}", mass<units::scaled_unit<mag, gram>>(1)) == "1 [2/3 x 10^-3] kg");
|
||||
// TODO(chogg): Reinstate after format/Magnitude redesign.
|
||||
// constexpr auto mag = units::as_magnitude<units::ratio{2, 3}>();
|
||||
// CHECK(STD_FMT::format("{}", mass<units::scaled_unit<mag, gram>>(1)) == "1 [2/3 × 10⁻³] kg");
|
||||
// CHECK(STD_FMT::format("{:%Q %Aq}", mass<units::scaled_unit<mag, gram>>(1)) == "1 [2/3 x 10^-3] kg");
|
||||
}
|
||||
}
|
||||
@@ -53,7 +53,7 @@ static_assert(10_q_cm == 2_q_cm_per_s * 5_q_s);
|
||||
static_assert(detail::unit_text<dim_speed, centimetre_per_second>() == "cm/s");
|
||||
|
||||
// area
|
||||
static_assert(centimetre::ratio / dimension_unit<dim_length>::ratio == ratio(1));
|
||||
static_assert(as_ratio(centimetre::mag / dimension_unit<dim_length>::mag) == ratio(1));
|
||||
|
||||
static_assert((1_q_cm * 1_q_cm).number() == 1);
|
||||
static_assert((1_q_cm2).number() == 1);
|
||||
|
||||
@@ -52,7 +52,7 @@ static_assert(10_q_ft == 2_q_ft_per_s * 5_q_s);
|
||||
static_assert(detail::unit_text<dim_speed, foot_per_second>() == "ft/s");
|
||||
|
||||
// area
|
||||
static_assert(foot::ratio / dimension_unit<dim_length>::ratio == ratio(1));
|
||||
static_assert(as_ratio(foot::mag / dimension_unit<dim_length>::mag) == ratio(1));
|
||||
|
||||
static_assert(1_q_ft * 1_q_ft == 1_q_ft2);
|
||||
static_assert(100_q_ft2 / 10_q_ft == 10_q_ft);
|
||||
@@ -61,7 +61,7 @@ static_assert(detail::unit_text<dim_area, square_foot>() == basic_symbol_text("f
|
||||
|
||||
// volume
|
||||
static_assert(1_q_yd * 1_q_yd * 1_q_yd == 1_q_yd3);
|
||||
static_assert(cubic_yard::ratio / cubic_foot::ratio == ratio(27));
|
||||
static_assert(as_ratio(cubic_yard::mag / cubic_foot::mag) == ratio(27));
|
||||
|
||||
/* ************** DERIVED DIMENSIONS WITH NAMED UNITS **************** */
|
||||
|
||||
|
||||
@@ -61,9 +61,7 @@ static_assert(equivalent<metre::named_unit, metre>);
|
||||
static_assert(equivalent<metre::scaled_unit, metre>);
|
||||
static_assert(compare<downcast<scaled_unit<as_magnitude<1>(), metre>>, metre>);
|
||||
static_assert(compare<downcast<scaled_unit<as_magnitude<ratio(1, 1, -2)>(), metre>>, centimetre>);
|
||||
static_assert(
|
||||
compare<downcast<scaled_unit<as_magnitude<ratio(yard::ratio.num, yard::ratio.den, yard::ratio.exp)>(), metre>>,
|
||||
yard>);
|
||||
static_assert(compare<downcast<scaled_unit<yard::mag, metre>>, yard>);
|
||||
static_assert(compare<downcast<scaled_unit<yard::mag / as_magnitude<3>(), metre>>, foot>);
|
||||
static_assert(compare<downcast<scaled_unit<kilometre::mag / hour::mag, metre_per_second>>, kilometre_per_hour>);
|
||||
|
||||
|
||||
Reference in new issue
Block a user