refactor(*): make type alias identifiers conform to the style for general type identifiers
This commit is contained in:
@ -33,7 +33,7 @@ struct IBidirectionalIterator /* : IForwardIterator<T> */
|
||||
{
|
||||
// ~Begin CForwardIterator.
|
||||
|
||||
using ElementType = TRemoveCVRef<T>;
|
||||
using FElementType = TRemoveCVRef<T>;
|
||||
|
||||
IBidirectionalIterator();
|
||||
IBidirectionalIterator(const IBidirectionalIterator&);
|
||||
|
@ -35,7 +35,7 @@ struct IContiguousIterator /* : IRandomAccessIterator<T> */
|
||||
{
|
||||
// ~Begin CRandomAccessIterator.
|
||||
|
||||
using ElementType = TRemoveCVRef<T>;
|
||||
using FElementType = TRemoveCVRef<T>;
|
||||
|
||||
IContiguousIterator();
|
||||
IContiguousIterator(const IContiguousIterator&);
|
||||
|
@ -18,8 +18,8 @@ NAMESPACE_MODULE_BEGIN(Utility)
|
||||
|
||||
NAMESPACE_PRIVATE_BEGIN
|
||||
|
||||
template <typename T> class TCountedIteratorImpl { };
|
||||
template <CIndirectlyReadable T> class TCountedIteratorImpl<T> { public: using ElementType = TIteratorElement<T>; };
|
||||
template <typename T> class TCountedIteratorImpl { };
|
||||
template <CIndirectlyReadable T> class TCountedIteratorImpl<T> { public: using FElementType = TIteratorElement<T>; };
|
||||
|
||||
NAMESPACE_PRIVATE_END
|
||||
|
||||
@ -34,7 +34,7 @@ class TCountedIterator final : public NAMESPACE_PRIVATE::TCountedIteratorImpl<I>
|
||||
{
|
||||
public:
|
||||
|
||||
using IteratorType = I;
|
||||
using FIteratorType = I;
|
||||
|
||||
# if DO_CHECK
|
||||
FORCEINLINE constexpr TCountedIterator() requires (CDefaultConstructible<I>) : Length(1), MaxLength(0) { }
|
||||
@ -48,7 +48,7 @@ public:
|
||||
FORCEINLINE constexpr TCountedIterator& operator=(TCountedIterator&&) = default;
|
||||
FORCEINLINE constexpr ~TCountedIterator() = default;
|
||||
|
||||
FORCEINLINE constexpr explicit TCountedIterator(IteratorType InValue, ptrdiff N) : Current(MoveTemp(InValue)) { check_code({ MaxLength = N; }); }
|
||||
FORCEINLINE constexpr explicit TCountedIterator(FIteratorType InValue, ptrdiff N) : Current(MoveTemp(InValue)) { check_code({ MaxLength = N; }); }
|
||||
|
||||
template <CInputOrOutputIterator J> requires (!CSameAs<I, J> && CConstructibleFrom<I, const J&>)
|
||||
FORCEINLINE constexpr explicit (!CConvertibleTo<const J&, I>) TCountedIterator(const TCountedIterator<J>& InValue)
|
||||
@ -106,14 +106,14 @@ public:
|
||||
NODISCARD friend FORCEINLINE constexpr ptrdiff operator-(const TCountedIterator& LHS, FDefaultSentinel) { LHS.CheckThis(); return -LHS.Num(); }
|
||||
NODISCARD friend FORCEINLINE constexpr ptrdiff operator-(FDefaultSentinel, const TCountedIterator& RHS) { RHS.CheckThis(); return RHS.Num(); }
|
||||
|
||||
NODISCARD FORCEINLINE constexpr const IteratorType& GetBase() const& { CheckThis(); return Current; }
|
||||
NODISCARD FORCEINLINE constexpr IteratorType GetBase() && { CheckThis(); return MoveTemp(Current); }
|
||||
NODISCARD FORCEINLINE constexpr ptrdiff Num() const { CheckThis(); return Length; }
|
||||
NODISCARD FORCEINLINE constexpr const FIteratorType& GetBase() const& { CheckThis(); return Current; }
|
||||
NODISCARD FORCEINLINE constexpr FIteratorType GetBase() && { CheckThis(); return MoveTemp(Current); }
|
||||
NODISCARD FORCEINLINE constexpr ptrdiff Num() const { CheckThis(); return Length; }
|
||||
|
||||
private:
|
||||
|
||||
IteratorType Current;
|
||||
ptrdiff Length;
|
||||
FIteratorType Current;
|
||||
ptrdiff Length;
|
||||
|
||||
# if DO_CHECK
|
||||
ptrdiff MaxLength;
|
||||
|
@ -24,7 +24,7 @@ struct IForwardIterator /* : IInputIterator<T>, IIncrementable, ISentinelFor<IFo
|
||||
{
|
||||
// ~Begin CInputIterator.
|
||||
|
||||
using ElementType = TRemoveCVRef<T>;
|
||||
using FElementType = TRemoveCVRef<T>;
|
||||
|
||||
// ~End CInputIterator.
|
||||
|
||||
|
@ -140,7 +140,7 @@ NODISCARD FORCEINLINE constexpr auto MakeBackInserter(C& Container)
|
||||
|
||||
/** Creates an iterator adapter inserted in the container. */
|
||||
template <typename C>
|
||||
NODISCARD FORCEINLINE constexpr auto MakeInserter(C& Container, const typename C::ConstIterator& InIter)
|
||||
NODISCARD FORCEINLINE constexpr auto MakeInserter(C& Container, const typename C::FConstIterator& InIter)
|
||||
{
|
||||
return NAMESPACE_PRIVATE::TInsertIterator([&Container, Iter = InIter]<typename T>(T&& A) mutable { Iter = Container.Insert(Iter, Forward<T>(A)); });
|
||||
}
|
||||
|
@ -26,9 +26,9 @@ class TMoveIterator final
|
||||
{
|
||||
public:
|
||||
|
||||
using IteratorType = I;
|
||||
using FIteratorType = I;
|
||||
|
||||
using ElementType = TIteratorElement<I>;
|
||||
using FElementType = TIteratorElement<I>;
|
||||
|
||||
FORCEINLINE constexpr TMoveIterator() requires (CDefaultConstructible<I>) = default;
|
||||
|
||||
@ -38,7 +38,7 @@ public:
|
||||
FORCEINLINE constexpr TMoveIterator& operator=(TMoveIterator&&) = default;
|
||||
FORCEINLINE constexpr ~TMoveIterator() = default;
|
||||
|
||||
FORCEINLINE constexpr explicit TMoveIterator(IteratorType InValue) : Current(MoveTemp(InValue)) { }
|
||||
FORCEINLINE constexpr explicit TMoveIterator(FIteratorType InValue) : Current(MoveTemp(InValue)) { }
|
||||
|
||||
template <CInputIterator J> requires (!CSameAs<I, J> && CConstructibleFrom<I, const J&>)
|
||||
FORCEINLINE constexpr explicit (!CConvertibleTo<const J&, I>) TMoveIterator(const TReverseIterator<J>& InValue) : Current(InValue.GetBase()) { }
|
||||
@ -73,12 +73,12 @@ public:
|
||||
|
||||
NODISCARD friend FORCEINLINE constexpr ptrdiff operator-(const TMoveIterator& LHS, const TMoveIterator& RHS) requires (CSizedSentinelFor<I, I>) { return LHS.GetBase() - RHS.GetBase(); }
|
||||
|
||||
NODISCARD FORCEINLINE constexpr const IteratorType& GetBase() const& { return Current; }
|
||||
NODISCARD FORCEINLINE constexpr IteratorType GetBase() && { return MoveTemp(Current); }
|
||||
NODISCARD FORCEINLINE constexpr const FIteratorType& GetBase() const& { return Current; }
|
||||
NODISCARD FORCEINLINE constexpr FIteratorType GetBase() && { return MoveTemp(Current); }
|
||||
|
||||
private:
|
||||
|
||||
IteratorType Current;
|
||||
FIteratorType Current;
|
||||
|
||||
};
|
||||
|
||||
@ -100,7 +100,7 @@ class TMoveSentinel
|
||||
{
|
||||
public:
|
||||
|
||||
using SentinelType = S;
|
||||
using FSentinelType = S;
|
||||
|
||||
FORCEINLINE constexpr TMoveSentinel() = default;
|
||||
FORCEINLINE constexpr TMoveSentinel(const TMoveSentinel&) = default;
|
||||
@ -109,7 +109,7 @@ public:
|
||||
FORCEINLINE constexpr TMoveSentinel& operator=(TMoveSentinel&&) = default;
|
||||
FORCEINLINE constexpr ~TMoveSentinel() = default;
|
||||
|
||||
FORCEINLINE constexpr explicit TMoveSentinel(SentinelType InValue) : Last(InValue) { }
|
||||
FORCEINLINE constexpr explicit TMoveSentinel(FSentinelType InValue) : Last(InValue) { }
|
||||
|
||||
template <CSemiregular T> requires (!CSameAs<S, T> && CConstructibleFrom<S, const T&>)
|
||||
FORCEINLINE constexpr explicit (!CConvertibleTo<const T&, S>) TMoveSentinel(const TMoveSentinel<T>& InValue) : Last(InValue.Last) { }
|
||||
@ -126,12 +126,12 @@ public:
|
||||
template <CInputIterator I> requires (CSizedSentinelFor<S, I>)
|
||||
NODISCARD friend FORCEINLINE constexpr ptrdiff operator-(const TMoveIterator<I>& Iter, const TMoveSentinel& Sentinel) { return Iter.GetBase() - Sentinel.GetBase(); }
|
||||
|
||||
NODISCARD FORCEINLINE constexpr const SentinelType& GetBase() const& { return Last; }
|
||||
NODISCARD FORCEINLINE constexpr SentinelType GetBase() && { return MoveTemp(Last); }
|
||||
NODISCARD FORCEINLINE constexpr const FSentinelType& GetBase() const& { return Last; }
|
||||
NODISCARD FORCEINLINE constexpr FSentinelType GetBase() && { return MoveTemp(Last); }
|
||||
|
||||
private:
|
||||
|
||||
SentinelType Last;
|
||||
FSentinelType Last;
|
||||
|
||||
};
|
||||
|
||||
|
@ -37,7 +37,7 @@ struct IRandomAccessIterator /* : IBidirectionalIterator<T>, ISizedSentinelFor<I
|
||||
{
|
||||
// ~Begin CBidirectionalIterator.
|
||||
|
||||
using ElementType = TRemoveCVRef<T>;
|
||||
using FElementType = TRemoveCVRef<T>;
|
||||
|
||||
// ~End CBidirectionalIterator.
|
||||
|
||||
|
@ -25,9 +25,9 @@ class TReverseIterator final
|
||||
{
|
||||
public:
|
||||
|
||||
using IteratorType = I;
|
||||
using FIteratorType = I;
|
||||
|
||||
using ElementType = TIteratorElement<I>;
|
||||
using FElementType = TIteratorElement<I>;
|
||||
|
||||
FORCEINLINE constexpr TReverseIterator() = default;
|
||||
FORCEINLINE constexpr TReverseIterator(const TReverseIterator&) = default;
|
||||
@ -36,7 +36,7 @@ public:
|
||||
FORCEINLINE constexpr TReverseIterator& operator=(TReverseIterator&&) = default;
|
||||
FORCEINLINE constexpr ~TReverseIterator() = default;
|
||||
|
||||
FORCEINLINE constexpr explicit TReverseIterator(IteratorType InValue) : Current(InValue) { }
|
||||
FORCEINLINE constexpr explicit TReverseIterator(FIteratorType InValue) : Current(InValue) { }
|
||||
|
||||
template <CBidirectionalIterator J> requires (!CSameAs<I, J> && CConstructibleFrom<I, const J&>)
|
||||
FORCEINLINE constexpr explicit (!CConvertibleTo<const J&, I>) TReverseIterator(const TReverseIterator<J>& InValue) : Current(InValue.GetBase()) { }
|
||||
@ -50,9 +50,9 @@ public:
|
||||
template <CBidirectionalIterator J> requires (CThreeWayComparable<I, J>)
|
||||
NODISCARD friend FORCEINLINE constexpr TCompareThreeWayResult<I, J> operator<=>(const TReverseIterator& LHS, const TReverseIterator<J>& RHS) { return RHS.GetBase() <=> LHS.GetBase(); }
|
||||
|
||||
NODISCARD FORCEINLINE constexpr TIteratorReference<I> operator*() const { IteratorType Temp = GetBase(); return *--Temp; }
|
||||
NODISCARD FORCEINLINE constexpr TIteratorReference<I> operator*() const { FIteratorType Temp = GetBase(); return *--Temp; }
|
||||
|
||||
NODISCARD FORCEINLINE constexpr auto operator->() const requires (requires(const I Iter) { { ToAddress(Iter) } -> CSameAs<TIteratorPointer<I>>; }) { IteratorType Temp = GetBase(); return ToAddress(--Temp); }
|
||||
NODISCARD FORCEINLINE constexpr auto operator->() const requires (requires(const I Iter) { { ToAddress(Iter) } -> CSameAs<TIteratorPointer<I>>; }) { FIteratorType Temp = GetBase(); return ToAddress(--Temp); }
|
||||
|
||||
NODISCARD FORCEINLINE constexpr TIteratorReference<I> operator[](ptrdiff Index) const requires (CRandomAccessIterator<I>) { return GetBase()[-Index - 1]; }
|
||||
|
||||
@ -72,12 +72,12 @@ public:
|
||||
|
||||
NODISCARD friend FORCEINLINE constexpr ptrdiff operator-(const TReverseIterator& LHS, const TReverseIterator& RHS) requires (CSizedSentinelFor<I, I>) { return RHS.GetBase() - LHS.GetBase(); }
|
||||
|
||||
NODISCARD FORCEINLINE constexpr const IteratorType& GetBase() const& { return Current; }
|
||||
NODISCARD FORCEINLINE constexpr IteratorType GetBase() && { return MoveTemp(Current); }
|
||||
NODISCARD FORCEINLINE constexpr const FIteratorType& GetBase() const& { return Current; }
|
||||
NODISCARD FORCEINLINE constexpr FIteratorType GetBase() && { return MoveTemp(Current); }
|
||||
|
||||
private:
|
||||
|
||||
IteratorType Current;
|
||||
FIteratorType Current;
|
||||
|
||||
};
|
||||
|
||||
|
@ -12,17 +12,17 @@ NAMESPACE_PRIVATE_BEGIN
|
||||
|
||||
template <typename T> using TWithReference = T&;
|
||||
|
||||
template <typename I> struct TIteratorElementImpl { };
|
||||
template <typename T> struct TIteratorElementImpl<T*> { using Type = TRemoveCV<T>; };
|
||||
template <typename I> struct TIteratorElementImpl { };
|
||||
template <typename T> struct TIteratorElementImpl<T*> { using FType = TRemoveCV<T>; };
|
||||
|
||||
template <typename I> requires (requires { typename I::ElementType; })
|
||||
struct TIteratorElementImpl<I> { using Type = typename I::ElementType; };
|
||||
template <typename I> requires (requires { typename I::FElementType; })
|
||||
struct TIteratorElementImpl<I> { using FType = typename I::FElementType; };
|
||||
|
||||
template <typename I> struct TIteratorPointerImpl { };
|
||||
template <typename T> struct TIteratorPointerImpl<T*> { using Type = T*; };
|
||||
template <typename I> struct TIteratorPointerImpl { };
|
||||
template <typename T> struct TIteratorPointerImpl<T*> { using FType = T*; };
|
||||
|
||||
template <typename I> requires (requires(I& Iter) { { Iter.operator->() } -> CPointer; })
|
||||
struct TIteratorPointerImpl<I> { using Type = decltype(DeclVal<I&>().operator->()); };
|
||||
struct TIteratorPointerImpl<I> { using FType = decltype(DeclVal<I&>().operator->()); };
|
||||
|
||||
NAMESPACE_PRIVATE_END
|
||||
|
||||
@ -33,10 +33,10 @@ template <typename T>
|
||||
concept CDereferenceable = requires(T& A) { { *A } -> CReferenceable; };
|
||||
|
||||
template <typename I>
|
||||
using TIteratorElement = typename NAMESPACE_PRIVATE::TIteratorElementImpl<TRemoveCVRef<I>>::Type;
|
||||
using TIteratorElement = typename NAMESPACE_PRIVATE::TIteratorElementImpl<TRemoveCVRef<I>>::FType;
|
||||
|
||||
template <typename I>
|
||||
using TIteratorPointer = typename NAMESPACE_PRIVATE::TIteratorPointerImpl<TRemoveCVRef<I>>::Type;
|
||||
using TIteratorPointer = typename NAMESPACE_PRIVATE::TIteratorPointerImpl<TRemoveCVRef<I>>::FType;
|
||||
|
||||
template <CReferenceable I>
|
||||
using TIteratorReference = decltype(*DeclVal<I&>());
|
||||
@ -75,13 +75,13 @@ struct IIndirectlyReadable
|
||||
* The element type of the indirectly readable type.
|
||||
* It must be a non-const, non-volatile and non-reference type and can be referenced, i.e. not a void type.
|
||||
*/
|
||||
using ElementType = TRemoveCVRef<T>;
|
||||
using FElementType = TRemoveCVRef<T>;
|
||||
|
||||
/**
|
||||
* Indirectly read the element from the indirectly readable type.
|
||||
* The return type may not be const ElementType&, this concept only requires that the return type
|
||||
* and ElementType has some relationship, such as copy constructible to ElementType if the type is copyable.
|
||||
* This means that returning a proxy class castable to ElementType is also valid.
|
||||
* The return type may not be const FElementType&, this concept only requires that the return type
|
||||
* and FElementType has some relationship, such as copy constructible to FElementType if the type is copyable.
|
||||
* This means that returning a proxy class castable to FElementType is also valid.
|
||||
* If this is an iterator adaptor, use decltype(auto) to forward the return value.
|
||||
*/
|
||||
T operator*() const;
|
||||
@ -227,7 +227,7 @@ struct IInputIterator /* : IInputOrOutputIterator, IIndirectlyReadable */
|
||||
{
|
||||
// ~Begin CIndirectlyReadable.
|
||||
|
||||
using ElementType = TRemoveCVRef<T>;
|
||||
using FElementType = TRemoveCVRef<T>;
|
||||
|
||||
// ~End CIndirectlyReadable.
|
||||
|
||||
|
Reference in New Issue
Block a user