fix(*): fix missing constexpr in some if constexpr

This commit is contained in:
Redstone1024 2024-12-17 15:49:46 +08:00
parent 00be872d5c
commit 50b1d2bb29
3 changed files with 4 additions and 4 deletions

View File

@ -66,7 +66,7 @@ public:
{ {
if constexpr (CForwardIterator<I>) if constexpr (CForwardIterator<I>)
{ {
if (CSizedSentinelFor<S, I>) { checkf(First <= Last, TEXT("Illegal range iterator. Please check First <= Last.")); } if constexpr (CSizedSentinelFor<S, I>) { checkf(First - Last <= 0, TEXT("Illegal range iterator. Please check First <= Last.")); }
const size_t Count = Iteration::Distance(First, Last); const size_t Count = Iteration::Distance(First, Last);
@ -418,7 +418,7 @@ public:
if constexpr (CForwardIterator<I>) if constexpr (CForwardIterator<I>)
{ {
if (CSizedSentinelFor<S, I>) { checkf(First <= Last, TEXT("Illegal range iterator. Please check First <= Last.")); } if constexpr (CSizedSentinelFor<S, I>) { checkf(First - Last <= 0, TEXT("Illegal range iterator. Please check First <= Last.")); }
const size_t InsertIndex = Iter - Begin(); const size_t InsertIndex = Iter - Begin();
const size_t Count = Iteration::Distance(First, Last); const size_t Count = Iteration::Distance(First, Last);

View File

@ -106,7 +106,7 @@ public:
{ {
if constexpr (CForwardIterator<I>) if constexpr (CForwardIterator<I>)
{ {
if (CSizedSentinelFor<S, I>) { checkf(First <= Last, TEXT("Illegal range iterator. Please check First <= Last.")); } if constexpr (CSizedSentinelFor<S, I>) { checkf(First - Last <= 0, TEXT("Illegal range iterator. Please check First <= Last.")); }
const size_t InCount = Iteration::Distance(First, Last); const size_t InCount = Iteration::Distance(First, Last);

View File

@ -471,7 +471,7 @@ public:
if constexpr (CForwardIterator<I>) if constexpr (CForwardIterator<I>)
{ {
if (CSizedSentinelFor<S, I>) { checkf(First <= Last, TEXT("Illegal range iterator. Please check First <= Last.")); } if constexpr (CSizedSentinelFor<S, I>) { checkf(First - Last <= 0, TEXT("Illegal range iterator. Please check First <= Last.")); }
const size_t InsertIndex = First - this->Begin(); const size_t InsertIndex = First - this->Begin();