Skip to content

Commit 6cad11a

Browse files
committed
test: remove redundant floating-point cross-unit comparison assertion
Floating-point comparisons always compile for any unit ratio; the purpose of this block is to verify integer comparisons are SFINAE'd out, which is already covered by no_cross_unit_int_comparison.
1 parent 0eea272 commit 6cad11a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

test/static/quantity_test.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1421,8 +1421,7 @@ static_assert(!(42 * m <= 0));
14211421
// type. A template wrapper is used so that the SFINAE failure inside the requires-expression
14221422
// is treated as a substitution failure rather than a hard error.
14231423
// cubic(km) vs cubic(pm): common-unit factor = 10^45 > 2^127, so integer comparison is
1424-
// ill-formed regardless of rep width. Floating-point is always fine.
1425-
static_assert(1. * isq::volume[cubic(km)] == 1e45 * isq::volume[cubic(pm)]);
1424+
// SFINAE'd out regardless of rep width.
14261425
template<Reference auto R1, Reference auto R2>
14271426
constexpr bool no_cross_unit_int_comparison = !requires { 1 * R1 == 1 * R2; } && !requires { 1 * R1 < 1 * R2; } &&
14281427
!requires { 1 * R2 == 1 * R1; } && !requires { 1 * R2 < 1 * R1; };

0 commit comments

Comments
 (0)