std::span<T,Extent>::back (3) - Linux Manuals

std::span<T,Extent>::back: std::span<T,Extent>::back

NAME

std::span<T,Extent>::back - std::span<T,Extent>::back

Synopsis


constexpr reference back() const;


Returns a reference to the last element in the span.
Calling back on an empty span results in undefined behavior.

Parameters


(none)

Return value


A reference to the back element.

Complexity


Constant

Notes


For a span c, the expression c.back() is equivalent to *(c.end()-1).

Example


 This section is incomplete
 Reason: no example

See also


      access the first element
front (public member function)