ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
detray::ranges::detail::subrange_view< range_t > Class Template Reference

Implements a subrange by providing start and end iterators on another range. More...

#include <detray/utils/ranges/subrange.hpp>

Inheritance diagram for detray::ranges::detail::subrange_view< range_t >:
[legend]
Collaboration diagram for detray::ranges::detail::subrange_view< range_t >:
[legend]

Public Types

using const_iterator_t = typename detray::ranges::const_iterator_t<range_t>
 Iterator type used when accessing a const view.
using difference_t = typename detray::ranges::range_difference_t<range_t>
 Difference type used for range positions.
using iterator_t = typename detray::ranges::iterator_t<range_t>
 Iterator type used to delimit the range.

Public Member Functions

constexpr subrange_view ()=default
 Default constructor.
constexpr subrange_view (iterator_t start, iterator_t end)
 Construct from an start and end iterator pair.
constexpr auto begin () -> iterator_t
 Return the first iterator.
constexpr auto begin () const -> const_iterator_t
 Return the first iterator of a const view.
constexpr auto end () -> iterator_t
 Return the end iterator.
constexpr auto end () const -> const_iterator_t
 Return the end iterator of a const view.
constexpr auto operator== (const subrange_view &rhs) const -> bool
 Equality operator.
Public Member Functions inherited from detray::ranges::view_interface< subrange_view< range_t > >
constexpr decltype(auto) back () const
 Return a reference to the last element.
constexpr auto data () const
 Return a pointer to the first element, or null for an empty view.
constexpr auto empty () const -> bool
 Check whether the view contains no elements.
constexpr decltype(auto) front () const
 Return a reference to the first element.
constexpr operator bool () const
 Test whether the view contains at least one element.
constexpr decltype(auto) operator[] (const dindex i) const
 Subscript operator that takes detray dindex.
constexpr auto size () const
 Return the number of elements in the view.

Detailed Description

template<detray::ranges::range range_t>
class detray::ranges::detail::subrange_view< range_t >

Implements a subrange by providing start and end iterators on another range.

See also
https://en.cppreference.com/w/cpp/ranges/subrange
Template Parameters
range_tthe iterable which to constrain to a subrange.

Constructor & Destructor Documentation

◆ subrange_view()

template<detray::ranges::range range_t>
detray::ranges::detail::subrange_view< range_t >::subrange_view ( iterator_t start,
iterator_t end )
constexpr

Construct from an start and end iterator pair.

Parameters
startFirst iterator in the view.
endEnd iterator of the view.

Member Function Documentation

◆ begin() [1/2]

template<detray::ranges::range range_t>
auto detray::ranges::detail::subrange_view< range_t >::begin ( ) ->iterator_t
constexpr

Return the first iterator.

Returns
start position of range.

◆ begin() [2/2]

template<detray::ranges::range range_t>
auto detray::ranges::detail::subrange_view< range_t >::begin ( ) const->const_iterator_t
constexpr

Return the first iterator of a const view.

Returns
start position of the range - const

◆ end() [1/2]

template<detray::ranges::range range_t>
auto detray::ranges::detail::subrange_view< range_t >::end ( ) ->iterator_t
constexpr

Return the end iterator.

Returns
sentinel of the range.

◆ end() [2/2]

template<detray::ranges::range range_t>
auto detray::ranges::detail::subrange_view< range_t >::end ( ) const->const_iterator_t
constexpr

Return the end iterator of a const view.

Returns
sentinel of the range.

◆ operator==()

template<detray::ranges::range range_t>
auto detray::ranges::detail::subrange_view< range_t >::operator== ( const subrange_view< range_t > & rhs) const->bool
constexpr

Equality operator.

Parameters
rhsthe subrange to compare with
Returns
whether the two subranges are equal