class MutableArrayRef

Declaration

template <typename T>
class MutableArrayRef { /* full declaration omitted */ };

Description

MutableArrayRef - Represent a mutable reference to an array (0 or more elements consecutively in memory), i.e. a start pointer and a length. It allows various APIs to take and modify consecutive elements easily and conveniently. This class does not own the underlying data, it is expected to be used in situations where the data resides in some other buffer, whose lifetime extends past that of the MutableArrayRef. For this reason, it is not in general safe to store a MutableArrayRef. This is intended to be trivially copyable, so it should be passed by value.

Declared at: llvm/include/llvm/ADT/ArrayRef.h:300

Templates

T

Method Overview

  • public MutableArrayRef<T>(llvm::NoneType)
  • public MutableArrayRef<T>(T & OneElt)
  • public MutableArrayRef<T>(T * data, size_t length)
  • public MutableArrayRef<T>(T * begin, T * end)
  • public MutableArrayRef<T>(SmallVectorImpl<T> & Vec)
  • public MutableArrayRef<T>(std::vector<T> & Vec)
  • public template <size_t N>constexpr MutableArrayRef<T>(T (&)[N] Arr)
  • public template <size_t N>constexpr MutableArrayRef<T>(std::array<T, N> & Arr)
  • public MutableArrayRef<T>()
  • public T & back() const
  • public llvm::MutableArrayRef::iterator begin() const
  • public T * data() const
  • public MutableArrayRef<T> drop_back(size_t N = 1) const
  • public MutableArrayRef<T> drop_front(size_t N = 1) const
  • public template <class PredicateT>MutableArrayRef<T> drop_until(PredicateT Pred) const
  • public template <class PredicateT>MutableArrayRef<T> drop_while(PredicateT Pred) const
  • public llvm::MutableArrayRef::iterator end() const
  • public T & front() const
  • public llvm::MutableArrayRef::reverse_iterator rbegin() const
  • public llvm::MutableArrayRef::reverse_iterator rend() const
  • public MutableArrayRef<T> slice(size_t N, size_t M) const
  • public MutableArrayRef<T> slice(size_t N) const
  • public MutableArrayRef<T> take_back(size_t N = 1) const
  • public MutableArrayRef<T> take_front(size_t N = 1) const
  • public template <class PredicateT>MutableArrayRef<T> take_until(PredicateT Pred) const
  • public template <class PredicateT>MutableArrayRef<T> take_while(PredicateT Pred) const

Methods

MutableArrayRef<T>(llvm::NoneType)

Description

Construct an empty MutableArrayRef from None.

Declared at: llvm/include/llvm/ADT/ArrayRef.h:309

Parameters

llvm::NoneType

MutableArrayRef<T>(T& OneElt)

Description

Construct an MutableArrayRef from a single element.

Declared at: llvm/include/llvm/ADT/ArrayRef.h:312

Parameters

T& OneElt

MutableArrayRef<T>(T* data, size_t length)

Description

Construct an MutableArrayRef from a pointer and length.

Declared at: llvm/include/llvm/ADT/ArrayRef.h:315

Parameters

T* data
size_t length

MutableArrayRef<T>(T* begin, T* end)

Description

Construct an MutableArrayRef from a range.

Declared at: llvm/include/llvm/ADT/ArrayRef.h:319

Parameters

T* begin
T* end

MutableArrayRef<T>(SmallVectorImpl<T>& Vec)

Description

Construct an MutableArrayRef from a SmallVector.

Declared at: llvm/include/llvm/ADT/ArrayRef.h:322

Parameters

SmallVectorImpl<T>& Vec

MutableArrayRef<T>(std::vector<T>& Vec)

Description

Construct a MutableArrayRef from a std::vector.

Declared at: llvm/include/llvm/ADT/ArrayRef.h:326

Parameters

std::vector<T>& Vec

template <size_t N>
constexpr MutableArrayRef<T>(T (&)[N] Arr)

Description

Construct an MutableArrayRef from a C array.

Declared at: llvm/include/llvm/ADT/ArrayRef.h:336

Templates

size_t N

Parameters

T (&)[N] Arr

template <size_t N>
constexpr MutableArrayRef<T>(
    std::array<T, N>& Arr)

Description

Construct an ArrayRef from a std::array

Declared at: llvm/include/llvm/ADT/ArrayRef.h:331

Templates

size_t N

Parameters

std::array<T, N>& Arr

MutableArrayRef<T>()

Description

Construct an empty MutableArrayRef.

Declared at: llvm/include/llvm/ADT/ArrayRef.h:306

T& back() const

Description

back - Get the last element.

Declared at: llvm/include/llvm/ADT/ArrayRef.h:353

llvm::MutableArrayRef::iterator begin() const

Declared at: llvm/include/llvm/ADT/ArrayRef.h:340

T* data() const

Declared at: llvm/include/llvm/ADT/ArrayRef.h:338

MutableArrayRef<T> drop_back(size_t N = 1) const

Declared at: llvm/include/llvm/ADT/ArrayRef.h:376

Parameters

size_t N = 1

MutableArrayRef<T> drop_front(size_t N = 1) const

Description

Drop the first \p N elements of the array.

Declared at: llvm/include/llvm/ADT/ArrayRef.h:371

Parameters

size_t N = 1

template <class PredicateT>
MutableArrayRef<T> drop_until(
    PredicateT Pred) const

Description

Return a copy of *this with the first N elements not satisfying the given predicate removed.

Declared at: llvm/include/llvm/ADT/ArrayRef.h:391

Templates

PredicateT

Parameters

PredicateT Pred

template <class PredicateT>
MutableArrayRef<T> drop_while(
    PredicateT Pred) const

Description

Return a copy of *this with the first N elements satisfying the given predicate removed.

Declared at: llvm/include/llvm/ADT/ArrayRef.h:384

Templates

PredicateT

Parameters

PredicateT Pred

llvm::MutableArrayRef::iterator end() const

Declared at: llvm/include/llvm/ADT/ArrayRef.h:341

T& front() const

Description

front - Get the first element.

Declared at: llvm/include/llvm/ADT/ArrayRef.h:347

llvm::MutableArrayRef::reverse_iterator rbegin()
    const

Declared at: llvm/include/llvm/ADT/ArrayRef.h:343

llvm::MutableArrayRef::reverse_iterator rend()
    const

Declared at: llvm/include/llvm/ADT/ArrayRef.h:344

MutableArrayRef<T> slice(size_t N, size_t M) const

Description

slice(n, m) - Chop off the first N elements of the array, and keep M elements in the array.

Declared at: llvm/include/llvm/ADT/ArrayRef.h:360

Parameters

size_t N
size_t M

MutableArrayRef<T> slice(size_t N) const

Description

slice(n) - Chop off the first N elements of the array.

Declared at: llvm/include/llvm/ADT/ArrayRef.h:366

Parameters

size_t N

MutableArrayRef<T> take_back(size_t N = 1) const

Description

Return a copy of *this with only the last \p N elements.

Declared at: llvm/include/llvm/ADT/ArrayRef.h:403

Parameters

size_t N = 1

MutableArrayRef<T> take_front(size_t N = 1) const

Description

Return a copy of *this with only the first \p N elements.

Declared at: llvm/include/llvm/ADT/ArrayRef.h:396

Parameters

size_t N = 1

template <class PredicateT>
MutableArrayRef<T> take_until(
    PredicateT Pred) const

Description

Return the first N elements of this Array that don't satisfy the given predicate.

Declared at: llvm/include/llvm/ADT/ArrayRef.h:419

Templates

PredicateT

Parameters

PredicateT Pred

template <class PredicateT>
MutableArrayRef<T> take_while(
    PredicateT Pred) const

Description

Return the first N elements of this Array that satisfy the given predicate.

Declared at: llvm/include/llvm/ADT/ArrayRef.h:412

Templates

PredicateT

Parameters

PredicateT Pred