fix(containers): fix the constant branch of Iteration::Distance never entered

This commit is contained in:
Redstone1024 2024-10-29 21:05:24 +08:00
parent e73cf69cb9
commit 615fb2429d

View File

@ -646,7 +646,7 @@ FORCEINLINE constexpr void Advance(I& Iter, ptrdiff N)
template <CInputIterator I, CSentinelFor<I> S> template <CInputIterator I, CSentinelFor<I> S>
FORCEINLINE constexpr ptrdiff Distance(I First, S Last) FORCEINLINE constexpr ptrdiff Distance(I First, S Last)
{ {
if constexpr (CSizedSentinelFor<I, S>) if constexpr (CSizedSentinelFor<S, I>)
{ {
return Last - First; return Last - First;
} }