|
| | TArrayView () |
| |
| template<typename OtherRangeType , typename CVUnqualifiedOtherRangeType = typename TRemoveCV<typename TRemoveReference<OtherRangeType>::Type>::Type, typename = typename TEnableIf< TAnd< TIsContiguousContainer<CVUnqualifiedOtherRangeType>, TOr< TIsCompatibleRangeType<OtherRangeType>, TIsReinterpretableRangeType<OtherRangeType> > >::Value >::Type, std::enable_if_t< TIsTArrayView< std::decay_t< OtherRangeType > >::Value > * = nullptr> |
| FORCEINLINE | TArrayView (OtherRangeType &&Other) |
| |
| template<typename OtherRangeType , typename CVUnqualifiedOtherRangeType = typename TRemoveCV<typename TRemoveReference<OtherRangeType>::Type>::Type, typename = typename TEnableIf< TAnd< TIsContiguousContainer<CVUnqualifiedOtherRangeType>, TOr< TIsCompatibleRangeType<OtherRangeType>, TIsReinterpretableRangeType<OtherRangeType> > >::Value >::Type, std::enable_if_t<!TIsTArrayView< std::decay_t< OtherRangeType > >::Value > * = nullptr> |
| FORCEINLINE | TArrayView (OtherRangeType &&Other UE_LIFETIMEBOUND) |
| |
| template<typename OtherElementType , typename = typename TEnableIf<TIsCompatibleElementType<OtherElementType>::Value>::Type> |
| FORCEINLINE | TArrayView (OtherElementType *InData UE_LIFETIMEBOUND, SizeType InCount) |
| |
| FORCEINLINE | TArrayView (std::initializer_list< ElementType > List UE_LIFETIMEBOUND) |
| |
| FORCEINLINE ElementType * | GetData () const |
| |
| FORCEINLINE void | CheckInvariants () const |
| |
| FORCEINLINE void | RangeCheck (SizeType Index) const |
| |
| FORCEINLINE void | SliceRangeCheck (SizeType Index, SizeType InNum) const |
| |
| FORCEINLINE bool | IsValidIndex (SizeType Index) const |
| |
| bool | IsEmpty () const |
| |
| FORCEINLINE SizeType | Num () const |
| |
| FORCEINLINE ElementType & | operator[] (SizeType Index) const |
| |
| FORCEINLINE ElementType & | Last (SizeType IndexFromTheEnd=0) const |
| |
| FORCEINLINE TArrayView | Slice (SizeType Index, SizeType InNum) const |
| |
| TArrayView | Left (SizeType Count) const |
| |
| TArrayView | LeftChop (SizeType Count) const |
| |
| TArrayView | Right (SizeType Count) const |
| |
| TArrayView | RightChop (SizeType Count) const |
| |
| TArrayView | Mid (SizeType Index, SizeType Count=TNumericLimits< SizeType >::Max()) const |
| |
| void | LeftInline (SizeType CharCount) |
| |
| void | LeftChopInline (SizeType CharCount) |
| |
| void | RightInline (SizeType CharCount) |
| |
| void | RightChopInline (SizeType CharCount) |
| |
| void | MidInline (SizeType Position, SizeType CharCount=TNumericLimits< SizeType >::Max()) |
| |
| FORCEINLINE bool | Find (const ElementType &Item, SizeType &Index) const |
| |
| SizeType | Find (const ElementType &Item) const |
| |
| FORCEINLINE bool | FindLast (const ElementType &Item, SizeType &Index) const |
| |
| template<typename Predicate > |
| SizeType | FindLastByPredicate (Predicate Pred, SizeType StartIndex) const |
| |
| template<typename Predicate > |
| FORCEINLINE SizeType | FindLastByPredicate (Predicate Pred) const |
| |
| template<typename KeyType > |
| SizeType | IndexOfByKey (const KeyType &Key) const |
| |
| template<typename Predicate > |
| SizeType | IndexOfByPredicate (Predicate Pred) const |
| |
| template<typename KeyType > |
| ElementType * | FindByKey (const KeyType &Key) const |
| |
| template<typename Predicate > |
| ElementType * | FindByPredicate (Predicate Pred) const |
| |
| template<typename Predicate > |
| TArray< typename TRemoveConst< ElementType >::Type > | FilterByPredicate (Predicate Pred) const |
| |
| template<typename ComparisonType > |
| bool | Contains (const ComparisonType &Item) const |
| |
| template<typename Predicate > |
| FORCEINLINE bool | ContainsByPredicate (Predicate Pred) const |
| |
| FORCEINLINE ElementType * | begin () const |
| |
| FORCEINLINE ElementType * | end () const |
| |
| void | Sort () |
| |
| template<class PREDICATE_CLASS > |
| void | Sort (const PREDICATE_CLASS &Predicate) |
| |
| void | StableSort () |
| |
| template<class PREDICATE_CLASS > |
| void | StableSort (const PREDICATE_CLASS &Predicate) |
| |
Templated fixed-size view of another array
A statically sized view of an array of typed elements. Designed to allow functions to take either a fixed C array or a TArray with an arbitrary allocator as an argument when the function neither adds nor removes elements
e.g.: int32 SumAll(TArrayView<const int32> array) { return Algo::Accumulate(array); }
could be called as: SumAll(MyTArray);\ SumAll(MyCArray); SumAll(MakeArrayView(Ptr, Num));
auto Values = { 1, 2, 3 }; SumAll(Values);
Note: View classes are not const-propagating! If you want a view where the elements are const, you need "TArrayView<const T>" not "const TArrayView<T>"!
Caution: Treat a view like a reference to the elements in the array. DO NOT free or reallocate the array while the view exists! For this reason, be mindful of lifetimes when constructing TArrayViews from rvalue initializer lists:
TArrayView<int> View = { 1, 2, 3 }; // construction of array view from rvalue initializer list int n = View[0]; // undefined behavior, as the initializer list was destroyed at the end of the previous line
Definition at line 129 of file ArrayView.h.