std::get(std::span) (3) - Linux Man Pages

std::get(std::span): std::get(std::span)


std::get(std::span) - std::get(std::span)


template< std::size_t I, class T, std::size_t N > (since C++20)
constexpr T& get( std::span<T,N> s ) noexcept;

Obtains a reference to the Ith element of the span s.
The span must have static extent (i.e., N != std::dynamic_extent) and I must be an integer value in range [0, N). This is enforced at compile time as opposed to operator[].


s - span whose contents to extract

Return value

A reference to the Ith element of s.




 This section is incomplete
 Reason: no example

See also

                       accesses an element of the sequence
operator[] (public member function)
                       tuple accesses specified element
std::get(std::tuple) (function template)

std::get(std::pair) accesses an element of a pair
                       (function template)

std::get(std::variant) reads the value of the variant given the index or the type (if the type is unique), throws on error
                       (function template)