Skip to content

Commit

Permalink
<mdspan>: Avoid -Wsign-compare warnings (#4227)
Browse files Browse the repository at this point in the history
  • Loading branch information
StephanTLavavej authored Dec 7, 2023
1 parent 4207ba2 commit d2e0f49
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions stl/inc/mdspan
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ public:
if constexpr (extents_type::rank() > 0) {
index_type _Prod = 1;
for (size_t _Idx = 0; _Idx < extents_type::_Rank; ++_Idx) {
_STL_VERIFY(_Other.stride(_Idx) == _Prod,
_STL_VERIFY(_STD cmp_equal(_Other.stride(_Idx), _Prod),
"For all r in the range [0, extents_type::rank()), other.stride(r) must be equal to "
"extents().fwd-prod-of-extents(r) (N4950 [mdspan.layout.left.cons]/10.1).");
_Prod = static_cast<index_type>(_Prod * this->_Exts.extent(_Idx));
Expand Down Expand Up @@ -690,7 +690,7 @@ public:
if constexpr (extents_type::rank() > 0) {
index_type _Prod = 1;
for (size_t _Idx = extents_type::_Rank; _Idx-- > 0;) {
_STL_VERIFY(_Prod == _Other.stride(_Idx),
_STL_VERIFY(_STD cmp_equal(_Prod, _Other.stride(_Idx)),
"For all r in the range [0, extents_type::rank()), other.stride(r) must be equal to "
"extents().rev-prod-of-extents(r) (N4950 [mdspan.layout.right.cons]/10.1).");
_Prod = static_cast<index_type>(_Prod * this->_Exts.extent(_Idx));
Expand Down

0 comments on commit d2e0f49

Please sign in to comment.