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

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

NAME

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

Synopsis


template< std::size_t Count >
constexpr std::span<element_type, Count> last() const;
constexpr std::span<element_type, std::dynamic_extent> last( std::size_t Count ) const;


Obtains a span that is a view over the last Count elements of this span. The behavior is undefined if Count > size().

Return value


A span r that is a view over the last Count elements of *this, such that r.data() == this->data() + (this->size() - Count) && r.size() == Count.

See also


        obtains a subspan consisting of the first N elements of the sequence
first (public member function)
        obtains a subspan
subspan (public member function)