From 85199119b393a22223e6254e2ead71d5fc9279c9 Mon Sep 17 00:00:00 2001 From: Redstone1024 <2824517378@qq.com> Date: Wed, 18 Dec 2024 21:45:25 +0800 Subject: [PATCH] fix(range): fix GetBase() of sentinel adapters such as TFilterView's --- Redcraft.Utility/Source/Public/Range/FilterView.h | 3 +-- Redcraft.Utility/Source/Public/Range/TakeView.h | 3 +-- Redcraft.Utility/Source/Public/Range/TransformView.h | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Redcraft.Utility/Source/Public/Range/FilterView.h b/Redcraft.Utility/Source/Public/Range/FilterView.h index 81b4912..7e3bc7c 100644 --- a/Redcraft.Utility/Source/Public/Range/FilterView.h +++ b/Redcraft.Utility/Source/Public/Range/FilterView.h @@ -136,8 +136,7 @@ private: NODISCARD FORCEINLINE constexpr bool operator==(const FIteratorImpl& InValue) const& { return Current == InValue.Current; } - NODISCARD FORCEINLINE constexpr const TRangeSentinel& GetBase() const& { return Current; } - NODISCARD FORCEINLINE constexpr TRangeSentinel GetBase() && { return MoveTemp(Current); } + NODISCARD FORCEINLINE constexpr TRangeSentinel GetBase() const { return Current; } private: diff --git a/Redcraft.Utility/Source/Public/Range/TakeView.h b/Redcraft.Utility/Source/Public/Range/TakeView.h index 2e17a4e..da71aff 100644 --- a/Redcraft.Utility/Source/Public/Range/TakeView.h +++ b/Redcraft.Utility/Source/Public/Range/TakeView.h @@ -126,8 +126,7 @@ private: return InValue.Num() == 0 || InValue.GetBase() == Current; } - NODISCARD FORCEINLINE constexpr const TRangeIterator& GetBase() const& { return Current; } - NODISCARD FORCEINLINE constexpr TRangeIterator GetBase() && { return MoveTemp(Current); } + NODISCARD FORCEINLINE constexpr TRangeSentinel GetBase() const { return Current; } private: diff --git a/Redcraft.Utility/Source/Public/Range/TransformView.h b/Redcraft.Utility/Source/Public/Range/TransformView.h index ef67112..dc4fa38 100644 --- a/Redcraft.Utility/Source/Public/Range/TransformView.h +++ b/Redcraft.Utility/Source/Public/Range/TransformView.h @@ -178,8 +178,7 @@ private: return RHS.GetBase() - LHS.GetBase(); } - NODISCARD FORCEINLINE constexpr const TRangeIterator& GetBase() const& { return Current; } - NODISCARD FORCEINLINE constexpr TRangeIterator GetBase() && { return MoveTemp(Current); } + NODISCARD FORCEINLINE constexpr TRangeSentinel GetBase() const { return Current; } private: