feat(range): add simple view concept and refactor related requires

This commit is contained in:
2024-12-19 12:04:22 +08:00
parent dd3a366c14
commit e6d525f2c3
3 changed files with 19 additions and 7 deletions

View File

@ -36,7 +36,7 @@ public:
FORCEINLINE constexpr TTakeView(V InBase, size_t InCount) : Base(MoveTemp(InBase)), Count(InCount) { }
NODISCARD FORCEINLINE constexpr auto Begin()
NODISCARD FORCEINLINE constexpr auto Begin() requires (!CSimpleView<V>)
{
if constexpr (CSizedRange<V>)
{
@ -62,7 +62,7 @@ public:
else return MakeCountedIterator(Range::Begin(Base), Count);
}
NODISCARD FORCEINLINE constexpr auto End()
NODISCARD FORCEINLINE constexpr auto End() requires (!CSimpleView<V>)
{
if constexpr (CSizedRange<V>)
{