Skip to content

Commit 5e9ea17

Browse files
committed
Resolve signedness issue
1 parent 88c063c commit 5e9ea17

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libcxx/include/__iterator/capacity_aware_iterator.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class __capacity_aware_iterator {
103103

104104
_LIBCPP_HIDE_FROM_ABI constexpr __capacity_aware_iterator& operator+=(difference_type __n) {
105105
_LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
106-
(__n >= 0 ? __n : -__n) <= _ContainerMaxElements,
106+
static_cast<size_t>((__n >= 0 ? __n : -__n)) <= _ContainerMaxElements,
107107
"__capacity_aware_iterator::operator+=: Attempting to move iterator past its "
108108
"container's possible range");
109109

@@ -113,7 +113,7 @@ class __capacity_aware_iterator {
113113

114114
_LIBCPP_HIDE_FROM_ABI constexpr __capacity_aware_iterator& operator-=(difference_type __n) {
115115
_LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
116-
(__n >= 0 ? __n : -__n) <= _ContainerMaxElements,
116+
static_cast<size_t>((__n >= 0 ? __n : -__n)) <= _ContainerMaxElements,
117117
"__capacity_aware_iterator::operator-=: Attempting to move iterator past its container's possible range");
118118

119119
__iter_ -= __n;

0 commit comments

Comments
 (0)