Skip to content

iris::Array< V, D > Class Template Reference

Doxygen 1.15.0 generates this reference during each site build from the public headers. The C++ guide shows the API in use.

A view of an array of depth D, whose elements are views of depth D - 1. More...

#include <iris/handle.hpp>

Classes

class  Iterator
 An iterator over the elements. More...

Public Types

using Element = detail::ViewOf<V, D - 1>::Type
 The view of an element.

Public Member Functions

std::size_t size () const
 Return the number of elements.
bool empty () const
 Whether there are no elements.
Element operator[] (std::size_t i) const
 Return element i, counted from 0.
Iterator begin () const
 Return an iterator at the first element.
Iterator end () const
 Return an iterator after the last element.
ValueRef value () const
 Return the untyped view of the array.

Detailed Description

template<HandleValue V, std::size_t D>
class iris::Array< V, D >

A view of an array of depth D, whose elements are views of depth D - 1.

Data::get returns it for an array of strings of depth 1 and for every array of depth 2 or more. Like ValueRef, it stays valid while any copy of the Data it comes from exists.

Member Typedef Documentation

Element

template<HandleValue V, std::size_t D>
using iris::Array< V, D >::Element = detail::ViewOf<V, D - 1>::Type

The view of an element.

Member Function Documentation

begin()

template<HandleValue V, std::size_t D>
Iterator iris::Array< V, D >::begin ( ) const
inlinenodiscard

Return an iterator at the first element.

empty()

template<HandleValue V, std::size_t D>
bool iris::Array< V, D >::empty ( ) const
inlinenodiscard

Whether there are no elements.

end()

template<HandleValue V, std::size_t D>
Iterator iris::Array< V, D >::end ( ) const
inlinenodiscard

Return an iterator after the last element.

operator[]()

template<HandleValue V, std::size_t D>
Element iris::Array< V, D >::operator[] ( std::size_t i) const
inlinenodiscard

Return element i, counted from 0.

Throws AccessError if i is out of range.

size()

template<HandleValue V, std::size_t D>
std::size_t iris::Array< V, D >::size ( ) const
inlinenodiscard

Return the number of elements.

value()

template<HandleValue V, std::size_t D>
ValueRef iris::Array< V, D >::value ( ) const
inlinenodiscard

Return the untyped view of the array.