From 28367fe63323d0d64041fd3bd35180c7967d7eeb Mon Sep 17 00:00:00 2001 From: Redstone1024 <2824517378@qq.com> Date: Tue, 10 Dec 2024 20:53:35 +0800 Subject: [PATCH] fix(miscellaneous): fix some iterator concepts and requires --- Redcraft.Utility/Source/Public/Miscellaneous/Iterator.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Redcraft.Utility/Source/Public/Miscellaneous/Iterator.h b/Redcraft.Utility/Source/Public/Miscellaneous/Iterator.h index 4a1ec32..7153349 100644 --- a/Redcraft.Utility/Source/Public/Miscellaneous/Iterator.h +++ b/Redcraft.Utility/Source/Public/Miscellaneous/Iterator.h @@ -210,13 +210,13 @@ FORCEINLINE void IndirectlySwap(I&& Iter, J&& Jter) Swap(*Iter, *Jter); } -template +template concept CIndirectlyCopyable = requires(const I Iter, const J Jter) { IndirectlyCopy(Iter, Jter); }; -template +template concept CIndirectlyMovable = requires(const I Iter, const J Jter) { IndirectlyMove(Iter, Jter); }; -template +template concept CIndirectlySwappable = CIndirectlyReadable && CIndirectlyReadable && requires(const I Iter, const J Jter) { @@ -361,7 +361,7 @@ public: NODISCARD FORCEINLINE constexpr TMoveIterator operator-(ptrdiff Offset) const requires (CRandomAccessIterator) { TMoveIterator Temp = *this; Temp -= Offset; return Temp; } - NODISCARD friend FORCEINLINE constexpr ptrdiff operator-(const TMoveIterator& LHS, const TMoveIterator& RHS) { return LHS.Current - RHS.Current; } + NODISCARD friend FORCEINLINE constexpr ptrdiff operator-(const TMoveIterator& LHS, const TMoveIterator& RHS) requires (CSizedSentinelFor) { return LHS.Current - RHS.Current; } NODISCARD FORCEINLINE constexpr const IteratorType& GetBase() const& { return Current; } NODISCARD FORCEINLINE constexpr IteratorType GetBase() && { return MoveTemp(Current); }