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:306

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:324

Parameters

llvm::NoneType

MutableArrayRef<T>(T& OneElt)

Description

Construct a MutableArrayRef from a single element.

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

Parameters

T& OneElt

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

Description

Construct a MutableArrayRef from a pointer and length.

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

Parameters

T* data
size_t length

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

Description

Construct a MutableArrayRef from a range.

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

Parameters

T* begin
T* end

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

Description

Construct a MutableArrayRef from a SmallVector.

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

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:341

Parameters

std::vector<T>& Vec

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

Description

Construct a MutableArrayRef from a C array.

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

Templates

size_t N

Parameters

T (&)[N] Arr

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

Description

Construct a MutableArrayRef from a std::array

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

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:321

T& back() const

Description

back - Get the last element.

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

llvm::MutableArrayRef::iterator begin() const

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

T* data() const

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

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

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

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:386

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:406

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:399

Templates

PredicateT

Parameters

PredicateT Pred

llvm::MutableArrayRef::iterator end() const

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

T& front() const

Description

front - Get the first element.

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

llvm::MutableArrayRef::reverse_iterator rbegin()
    const

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

llvm::MutableArrayRef::reverse_iterator rend()
    const

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

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:375

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:381

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:418

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:411

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:434

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:427

Templates

PredicateT

Parameters

PredicateT Pred