std::span<T,Extent>::front
From cppreference.net
constexpr reference front() const; |
(since C++20) | |
Returns a reference to the first element in the span.
If |
(until C++26) |
If
|
(since C++26) |
Return value
A reference to the first element.
Complexity
Constant.
Notes
For a span c, the expression c.front() is equivalent to *c.begin().
Example
Run this code
Output:
0 1 2 3
See also
access the last element (public member function) |