Skip to content

Commit d2e0f49

Browse files
<mdspan>: Avoid -Wsign-compare warnings (#4227)
1 parent 4207ba2 commit d2e0f49

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

stl/inc/mdspan

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ public:
538538
if constexpr (extents_type::rank() > 0) {
539539
index_type _Prod = 1;
540540
for (size_t _Idx = 0; _Idx < extents_type::_Rank; ++_Idx) {
541-
_STL_VERIFY(_Other.stride(_Idx) == _Prod,
541+
_STL_VERIFY(_STD cmp_equal(_Other.stride(_Idx), _Prod),
542542
"For all r in the range [0, extents_type::rank()), other.stride(r) must be equal to "
543543
"extents().fwd-prod-of-extents(r) (N4950 [mdspan.layout.left.cons]/10.1).");
544544
_Prod = static_cast<index_type>(_Prod * this->_Exts.extent(_Idx));
@@ -690,7 +690,7 @@ public:
690690
if constexpr (extents_type::rank() > 0) {
691691
index_type _Prod = 1;
692692
for (size_t _Idx = extents_type::_Rank; _Idx-- > 0;) {
693-
_STL_VERIFY(_Prod == _Other.stride(_Idx),
693+
_STL_VERIFY(_STD cmp_equal(_Prod, _Other.stride(_Idx)),
694694
"For all r in the range [0, extents_type::rank()), other.stride(r) must be equal to "
695695
"extents().rev-prod-of-extents(r) (N4950 [mdspan.layout.right.cons]/10.1).");
696696
_Prod = static_cast<index_type>(_Prod * this->_Exts.extent(_Idx));

0 commit comments

Comments
 (0)