ArrayRef

#include <poplar/ArrayRef.hpp>

References to arrays.

namespace poplar

Poplar classes and functions.

Functions

template<class T>
inline bool operator==(const ArrayRef<T> &l, const ArrayRef<T> &r)
template<class T>
inline bool operator!=(const ArrayRef<T> &l, const ArrayRef<T> &r)
template<class T>
class ArrayRef

Subclassed by poplar::StringRef

Public Types

using value_type = T
using reference = T&
using const_reference = const T&
using difference_type = std::ptrdiff_t
using size_type = std::size_t
using iterator = const T*
using const_iterator = const T*

Public Functions

ArrayRef(std::nullptr_t) = delete
inline constexpr ArrayRef()
inline constexpr ArrayRef(const T *p, std::size_t size)
template<class U, class Alloc, typename std::enable_if<std::is_same<U, T>::value || (std::is_pointer<T>::value && std::is_convertible<U const*, T const*>::value), bool>::type = true>
inline ArrayRef(const std::vector<U, Alloc> &v)
template<std::size_t N>
inline constexpr ArrayRef(const std::array<T, N> &a)
template<std::size_t N>
inline constexpr ArrayRef(const T (&p)[N])
inline constexpr ArrayRef(const std::initializer_list<T> &list)
template<class U, typename std::enable_if<std::is_same<U, T>::value || (std::is_pointer<T>::value && std::is_convertible<U const*, T const*>::value), bool>::type = true>
inline constexpr ArrayRef(const ArrayRef<U> &a)
inline constexpr const T *data() const
inline constexpr std::size_t size() const
inline constexpr bool empty() const
inline const T &front() const
inline const T &operator[](std::size_t i) const
inline const_iterator begin() const
inline const_iterator end() const
inline const_iterator cbegin() const
inline const_iterator cend() const
inline std::vector<T> cloneAsVector() const
inline std::size_t max_size() const

Private Members

const T *ptr
std::size_t len