.. Copyright 2023 Julien Blanc Distributed under the Boost Software License, Version 1.0. https://www.boost.org/LICENSE_1_0.txt indexed_span ============ .. toctree:: :hidden: indexedspan_constructors indexedspan_dataaccess indexedspan_iterators indexedspan_observers .. cpp:class:: template indexed_span Span-like class which allows accessing elements through a custom indexer. ``indexed_span`` does not own the data, and its size is always known at compile time (it always cover the full ``Indexer`` range). It is multidimensional if the Indexer is. It is related to ``std::span`` and has a similar interface. The primary use case for ``indexed_span`` is that it is the type returned by a multidimensional ``indexed_array`` when accessing a lower-rank dimension via the ``slice()`` method. Construction and destruction ---------------------------- +---------------------------------------------------------------------+--------------------------------+ | *Constructors* | | +=====================================================================+================================+ | ``indexed_span() = delete`` | default constructor is deleted | +---------------------------------------------------------------------+--------------------------------+ | | :ref:`indexed_span(indexed_span const&) ` | copy/move operators defaulted | | | :ref:`operator=(indexed_span const&) ` | | +---------------------------------------------------------------------+--------------------------------+ | :ref:`indexed_span(Value*) ` | constructor from a ``Value*`` | +---------------------------------------------------------------------+--------------------------------+ Member functions ---------------- Data access ^^^^^^^^^^^ +---------------------------------------------------------------------+--------------------------------+ | *Functions always present* | | +=====================================================================+================================+ | :ref:`indexed_span::at(index) const ` | Element access (range-checked) | +---------------------------------------------------------------------+--------------------------------+ | :ref:`indexed_span::operator[](index) const ` | Element access (unchecked) | +---------------------------------------------------------------------+--------------------------------+ | :ref:`indexed_span::data() const ` | Access to raw storage | +---------------------------------------------------------------------+--------------------------------+ | :ref:`indexed_span::front() const ` | Access to first element | +---------------------------------------------------------------------+--------------------------------+ | :ref:`indexed_span::back() const ` | Access to last element | +---------------------------------------------------------------------+--------------------------------+ | *Multidimensional specific* | | +---------------------------------------------------------------------+--------------------------------+ | | :ref:`indexed_span::slice(1d-index) const ` | Access to subrank | | | :ref:`indexed_span::slice_at(1d-index) const `| | +---------------------------------------------------------------------+--------------------------------+ Observers ^^^^^^^^^ +------------------------------------------------------------------+-----------------------------------+ | :ref:`indexed_span::empty() const ` | Checks sequence for emptiness | +------------------------------------------------------------------+-----------------------------------+ | :ref:`indexed_span::size() const ` | Returns the size of the sequence | +------------------------------------------------------------------+-----------------------------------+ Iteration ^^^^^^^^^ +---------------------------------------------------------------------+-------------------------------+ | | :ref:`indexed_span::begin() ` | Iterator to start of sequence | | | :ref:`indexed_span::cbegin() ` | | +---------------------------------------------------------------------+-------------------------------+ | | :ref:`indexed_span::end() ` | Iterator past the end of | | | :ref:`indexed_span::cend() ` | the sequence | +---------------------------------------------------------------------+-------------------------------+ | | :ref:`indexed_span::rbegin() ` | Iterator to start of reverse | | | :ref:`indexed_span::crbegin() ` | sequence | +---------------------------------------------------------------------+-------------------------------+ | | :ref:`indexed_span::rend() ` | Iterator past the end of | | | :ref:`indexed_span::crend() ` | the reverse sequence | +---------------------------------------------------------------------+-------------------------------+