OpenKalman
Public Member Functions | List of all members
OpenKalman::collections::slice_view< V, Offset, Extent > Struct Template Reference

A view representing a slice of a collection. More...

#include <slice.hpp>

Inheritance diagram for OpenKalman::collections::slice_view< V, Offset, Extent >:
Inheritance graph
[legend]
Collaboration diagram for OpenKalman::collections::slice_view< V, Offset, Extent >:
Collaboration graph
[legend]

Public Member Functions

template<bool Enable = true, std::enable_if_t< Enable and std::is_default_constructible_v< V > and std::is_default_constructible_v< Offset > and std::is_default_constructible_v< Extent >, int > = 0>
constexpr slice_view ()
 Default constructor.
 
constexpr slice_view (const V &v, Offset offset, Extent extent)
 Construct from a collection.
 
constexpr slice_view (V &&v, Offset offset, Extent extent)
 
constexpr V & base () &
 The base view.
 
constexpr const V & base () const &
 
constexpr V && base () &&noexcept
 
constexpr const V && base () const &&noexcept
 
constexpr auto begin () &
 
constexpr auto begin () const &
 
constexpr auto begin () &&noexcept
 
constexpr auto begin () const &&noexcept
 
constexpr auto end () &
 
constexpr auto end () const &
 
constexpr auto end () &&noexcept
 
constexpr auto end () const &&noexcept
 
constexpr auto size () const noexcept
 
template<std::size_t i>
decltype(auto) constexpr get () &
 Get element i.
 
template<std::size_t i>
decltype(auto) constexpr get () const &
 
template<std::size_t i>
decltype(auto) constexpr get () &&noexcept
 
template<std::size_t i>
decltype(auto) constexpr get () const &&noexcept
 
- Public Member Functions inherited from OpenKalman::ranges::view_interface< slice_view< V, Offset, Extent > >
constexpr bool empty ()
 
constexpr bool empty () const
 
constexpr auto cbegin ()
 
constexpr auto cbegin () const
 
constexpr auto cend ()
 
constexpr auto cend () const
 
constexpr operator bool ()
 
constexpr operator bool () const
 
constexpr auto size ()
 
constexpr auto size () const
 
decltype(auto) constexpr front ()
 
decltype(auto) constexpr front () const
 
decltype(auto) constexpr back ()
 
decltype(auto) constexpr back () const
 
decltype(auto) constexpr operator[] (range_difference_t< D > n)
 
decltype(auto) constexpr operator[] (range_difference_t< D > n) const
 

Detailed Description

template<typename V, typename Offset, typename Extent>
struct OpenKalman::collections::slice_view< V, Offset, Extent >

A view representing a slice of a collection.

The following should compile:

Template Parameters
OffsetThe offset to the beginning of the slice
ExtentThe size of the slice
See also
views::slice

Constructor & Destructor Documentation

◆ slice_view()

template<typename V , typename Offset , typename Extent >
constexpr OpenKalman::collections::slice_view< V, Offset, Extent >::slice_view ( V &&  v,
Offset  offset,
Extent  extent 
)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Member Function Documentation

◆ begin()

template<typename V , typename Offset , typename Extent >
constexpr auto OpenKalman::collections::slice_view< V, Offset, Extent >::begin ( ) &
inline
Returns
An iterator at the beginning, if the base object is a range.

◆ end()

template<typename V , typename Offset , typename Extent >
constexpr auto OpenKalman::collections::slice_view< V, Offset, Extent >::end ( ) &
inline
Returns
An iterator at the end, if the base object is a range.

◆ size()

template<typename V , typename Offset , typename Extent >
constexpr auto OpenKalman::collections::slice_view< V, Offset, Extent >::size ( ) const
inlinenoexcept
Returns
The size of the object.

The documentation for this struct was generated from the following file: