ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
detray::ranges::views::single< value_t > Struct Template Reference

interface type to construct a single_view with CTAD More...

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

Inheritance diagram for detray::ranges::views::single< value_t >:
[legend]
Collaboration diagram for detray::ranges::views::single< value_t >:
[legend]

Public Types

using base_type = detray::ranges::single_view<value_t>
 Base implementation storing the single value.
Public Types inherited from detray::ranges::single_view< value_t >
using iterator_t = value_t*
 Pointer iterator over the single stored element.

Public Member Functions

template<typename deduced_value_t>
requires (!std::same_as<deduced_value_t, single>)
constexpr single (const deduced_value_t &value)
 Construct the view by copying a value.
template<typename deduced_value_t>
requires (!std::same_as<deduced_value_t, single>)
constexpr single (deduced_value_t &&value)
 Construct the view by moving a value.
template<class... Args>
constexpr single (std::in_place_t, Args &&... args)
 Construct the stored value in place.
Public Member Functions inherited from detray::ranges::single_view< value_t >
constexpr single_view ()=default
 Default constructor.
constexpr single_view (const value_t &value)
 Construct the view by copying its single element.
template<class... Args>
constexpr single_view (std::in_place_t, Args &&... args)
 Construct value in place from args.
constexpr single_view (value_t &&value)
 Construct the view by moving in its single element.
constexpr auto back () noexcept -> value_t
constexpr auto begin () const noexcept -> const value_t *
constexpr auto begin () noexcept -> value_t *
constexpr auto data () const noexcept -> const value_t *
constexpr auto data () noexcept -> value_t *
constexpr auto end () const noexcept -> const value_t *
constexpr auto end () noexcept -> value_t *
constexpr auto front () noexcept -> value_t
constexpr auto operator[] (const dindex) const -> value_t
constexpr auto ref () -> value_t &
 Return a mutable reference to the stored element.
constexpr auto ref () const -> const value_t &
 Return a const reference to the stored element.
constexpr auto value () const -> value_t
 Return the single stored value by value.
Public Member Functions inherited from detray::ranges::view_interface< single_view< value_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.

Additional Inherited Members

Static Public Member Functions inherited from detray::ranges::single_view< value_t >
static constexpr auto size () noexcept -> std::size_t

Detailed Description

template<typename value_t>
struct detray::ranges::views::single< value_t >

interface type to construct a single_view with CTAD

Constructor & Destructor Documentation

◆ single() [1/3]

template<typename value_t>
template<typename deduced_value_t>
requires (!std::same_as<deduced_value_t, single>)
detray::ranges::views::single< value_t >::single ( const deduced_value_t & value)
explicitconstexpr

Construct the view by copying a value.

Parameters
valuevalue to copy

◆ single() [2/3]

template<typename value_t>
template<typename deduced_value_t>
requires (!std::same_as<deduced_value_t, single>)
detray::ranges::views::single< value_t >::single ( deduced_value_t && value)
explicitconstexpr

Construct the view by moving a value.

Parameters
valuevalue to move

◆ single() [3/3]

template<typename value_t>
template<class... Args>
detray::ranges::views::single< value_t >::single ( std::in_place_t ,
Args &&... args )
explicitconstexpr

Construct the stored value in place.

Template Parameters
Argsvalue constructor argument types
Parameters
argsarguments forwarded to the value constructor