fix(algorithms): fix requires for Algorithms::Distance()

This commit is contained in:
Redstone1024 2024-12-22 15:21:09 +08:00
parent db855d27a1
commit aa572542e2

View File

@ -115,11 +115,11 @@ NODISCARD FORCEINLINE constexpr ptrdiff Distance(I First, S Last)
} }
} }
/** @return The size of the range. */ /** @return The size of the range. The range will not be modified if it is a sized range. */
template <CRange R> template <CRange R>
NODISCARD FORCEINLINE constexpr ptrdiff Distance(R&& Range) NODISCARD FORCEINLINE constexpr ptrdiff Distance(R&& Range)
{ {
if constexpr (CSizedRange<R>) if constexpr (CSizedRange<R&>)
{ {
return static_cast<ptrdiff>(Ranges::Num(Range)); return static_cast<ptrdiff>(Ranges::Num(Range));
} }