LLVM 19.0.0git
Public Member Functions | List of all members
llvm::OwningArrayRef< T > Class Template Reference

This is a MutableArrayRef that owns its array. More...

#include "llvm/ADT/ArrayRef.h"

Inheritance diagram for llvm::OwningArrayRef< T >:
Inheritance graph
[legend]

Public Member Functions

 OwningArrayRef ()=default
 
 OwningArrayRef (size_t Size)
 
 OwningArrayRef (ArrayRef< T > Data)
 
 OwningArrayRef (OwningArrayRef &&Other)
 
OwningArrayRefoperator= (OwningArrayRef &&Other)
 
 ~OwningArrayRef ()
 
- Public Member Functions inherited from llvm::MutableArrayRef< T >
 MutableArrayRef ()=default
 Construct an empty MutableArrayRef.
 
 MutableArrayRef (std::nullopt_t)
 Construct an empty MutableArrayRef from std::nullopt.
 
 MutableArrayRef (T &OneElt)
 Construct a MutableArrayRef from a single element.
 
 MutableArrayRef (T *data, size_t length)
 Construct a MutableArrayRef from a pointer and length.
 
 MutableArrayRef (T *begin, T *end)
 Construct a MutableArrayRef from a range.
 
 MutableArrayRef (SmallVectorImpl< T > &Vec)
 Construct a MutableArrayRef from a SmallVector.
 
 MutableArrayRef (std::vector< T > &Vec)
 Construct a MutableArrayRef from a std::vector.
 
template<size_t N>
constexpr MutableArrayRef (std::array< T, N > &Arr)
 Construct a MutableArrayRef from a std::array.
 
template<size_t N>
constexpr MutableArrayRef (T(&Arr)[N])
 Construct a MutableArrayRef from a C array.
 
Tdata () const
 
iterator begin () const
 
iterator end () const
 
reverse_iterator rbegin () const
 
reverse_iterator rend () const
 
Tfront () const
 front - Get the first element.
 
Tback () const
 back - Get the last element.
 
MutableArrayRef< Tslice (size_t N, size_t M) const
 slice(n, m) - Chop off the first N elements of the array, and keep M elements in the array.
 
MutableArrayRef< Tslice (size_t N) const
 slice(n) - Chop off the first N elements of the array.
 
MutableArrayRef< Tdrop_front (size_t N=1) const
 Drop the first N elements of the array.
 
MutableArrayRef< Tdrop_back (size_t N=1) const
 
template<class PredicateT >
MutableArrayRef< Tdrop_while (PredicateT Pred) const
 Return a copy of *this with the first N elements satisfying the given predicate removed.
 
template<class PredicateT >
MutableArrayRef< Tdrop_until (PredicateT Pred) const
 Return a copy of *this with the first N elements not satisfying the given predicate removed.
 
MutableArrayRef< Ttake_front (size_t N=1) const
 Return a copy of *this with only the first N elements.
 
MutableArrayRef< Ttake_back (size_t N=1) const
 Return a copy of *this with only the last N elements.
 
template<class PredicateT >
MutableArrayRef< Ttake_while (PredicateT Pred) const
 Return the first N elements of this Array that satisfy the given predicate.
 
template<class PredicateT >
MutableArrayRef< Ttake_until (PredicateT Pred) const
 Return the first N elements of this Array that don't satisfy the given predicate.
 
Toperator[] (size_t Index) const
 
- Public Member Functions inherited from llvm::ArrayRef< T >
 ArrayRef ()=default
 Construct an empty ArrayRef.
 
 ArrayRef (std::nullopt_t)
 Construct an empty ArrayRef from std::nullopt.
 
 ArrayRef (const T &OneElt)
 Construct an ArrayRef from a single element.
 
constexpr ArrayRef (const T *data, size_t length)
 Construct an ArrayRef from a pointer and length.
 
constexpr ArrayRef (const T *begin, const T *end)
 Construct an ArrayRef from a range.
 
template<typename U >
 ArrayRef (const SmallVectorTemplateCommon< T, U > &Vec)
 Construct an ArrayRef from a SmallVector.
 
template<typename A >
 ArrayRef (const std::vector< T, A > &Vec)
 Construct an ArrayRef from a std::vector.
 
template<size_t N>
constexpr ArrayRef (const std::array< T, N > &Arr)
 Construct an ArrayRef from a std::array.
 
template<size_t N>
constexpr ArrayRef (const T(&Arr)[N])
 Construct an ArrayRef from a C array.
 
constexpr ArrayRef (const std::initializer_list< T > &Vec)
 Construct an ArrayRef from a std::initializer_list.
 
template<typename U >
 ArrayRef (const ArrayRef< U * > &A, std::enable_if_t< std::is_convertible< U *const *, T const * >::value > *=nullptr)
 Construct an ArrayRef<const T*> from ArrayRef<T*>.
 
template<typename U , typename DummyT >
 ArrayRef (const SmallVectorTemplateCommon< U *, DummyT > &Vec, std::enable_if_t< std::is_convertible< U *const *, T const * >::value > *=nullptr)
 Construct an ArrayRef<const T*> from a SmallVector<T*>.
 
template<typename U , typename A >
 ArrayRef (const std::vector< U *, A > &Vec, std::enable_if_t< std::is_convertible< U *const *, T const * >::value > *=nullptr)
 Construct an ArrayRef<const T*> from std::vector<T*>.
 
iterator begin () const
 
iterator end () const
 
reverse_iterator rbegin () const
 
reverse_iterator rend () const
 
bool empty () const
 empty - Check if the array is empty.
 
const Tdata () const
 
size_t size () const
 size - Get the array size.
 
const Tfront () const
 front - Get the first element.
 
const Tback () const
 back - Get the last element.
 
template<typename Allocator >
MutableArrayRef< Tcopy (Allocator &A)
 
bool equals (ArrayRef RHS) const
 equals - Check for element-wise equality.
 
ArrayRef< Tslice (size_t N, size_t M) const
 slice(n, m) - Chop off the first N elements of the array, and keep M elements in the array.
 
ArrayRef< Tslice (size_t N) const
 slice(n) - Chop off the first N elements of the array.
 
ArrayRef< Tdrop_front (size_t N=1) const
 Drop the first N elements of the array.
 
ArrayRef< Tdrop_back (size_t N=1) const
 Drop the last N elements of the array.
 
template<class PredicateT >
ArrayRef< Tdrop_while (PredicateT Pred) const
 Return a copy of *this with the first N elements satisfying the given predicate removed.
 
template<class PredicateT >
ArrayRef< Tdrop_until (PredicateT Pred) const
 Return a copy of *this with the first N elements not satisfying the given predicate removed.
 
ArrayRef< Ttake_front (size_t N=1) const
 Return a copy of *this with only the first N elements.
 
ArrayRef< Ttake_back (size_t N=1) const
 Return a copy of *this with only the last N elements.
 
template<class PredicateT >
ArrayRef< Ttake_while (PredicateT Pred) const
 Return the first N elements of this Array that satisfy the given predicate.
 
template<class PredicateT >
ArrayRef< Ttake_until (PredicateT Pred) const
 Return the first N elements of this Array that don't satisfy the given predicate.
 
const Toperator[] (size_t Index) const
 
template<typename U >
std::enable_if_t< std::is_same< U, T >::value, ArrayRef< T > > & operator= (U &&Temporary)=delete
 Disallow accidental assignment from a temporary.
 
template<typename U >
std::enable_if_t< std::is_same< U, T >::value, ArrayRef< T > > & operator= (std::initializer_list< U >)=delete
 Disallow accidental assignment from a temporary.
 
std::vector< Tvec () const
 
 operator std::vector< T > () const
 

Additional Inherited Members

- Public Types inherited from llvm::MutableArrayRef< T >
using value_type = T
 
using pointer = value_type *
 
using const_pointer = const value_type *
 
using reference = value_type &
 
using const_reference = const value_type &
 
using iterator = pointer
 
using const_iterator = const_pointer
 
using reverse_iterator = std::reverse_iterator< iterator >
 
using const_reverse_iterator = std::reverse_iterator< const_iterator >
 
using size_type = size_t
 
using difference_type = ptrdiff_t
 
- Public Types inherited from llvm::ArrayRef< T >
using value_type = T
 
using pointer = value_type *
 
using const_pointer = const value_type *
 
using reference = value_type &
 
using const_reference = const value_type &
 
using iterator = const_pointer
 
using const_iterator = const_pointer
 
using reverse_iterator = std::reverse_iterator< iterator >
 
using const_reverse_iterator = std::reverse_iterator< const_iterator >
 
using size_type = size_t
 
using difference_type = ptrdiff_t
 

Detailed Description

template<typename T>
class llvm::OwningArrayRef< T >

This is a MutableArrayRef that owns its array.

Definition at line 449 of file ArrayRef.h.

Constructor & Destructor Documentation

◆ OwningArrayRef() [1/4]

template<typename T >
llvm::OwningArrayRef< T >::OwningArrayRef ( )
default

◆ OwningArrayRef() [2/4]

template<typename T >
llvm::OwningArrayRef< T >::OwningArrayRef ( size_t  Size)
inline

Definition at line 452 of file ArrayRef.h.

◆ OwningArrayRef() [3/4]

template<typename T >
llvm::OwningArrayRef< T >::OwningArrayRef ( ArrayRef< T Data)
inline

Definition at line 454 of file ArrayRef.h.

◆ OwningArrayRef() [4/4]

template<typename T >
llvm::OwningArrayRef< T >::OwningArrayRef ( OwningArrayRef< T > &&  Other)
inline

Definition at line 459 of file ArrayRef.h.

References llvm::Other.

◆ ~OwningArrayRef()

template<typename T >
llvm::OwningArrayRef< T >::~OwningArrayRef ( )
inline

Definition at line 468 of file ArrayRef.h.

References llvm::MutableArrayRef< T >::data().

Member Function Documentation

◆ operator=()

template<typename T >
OwningArrayRef & llvm::OwningArrayRef< T >::operator= ( OwningArrayRef< T > &&  Other)
inline

The documentation for this class was generated from the following file: