std::span<T,Extent>::data - cppreference.com
From cppreference.com
|
|
(since C++20) | |
Returns a pointer to the beginning of the underlying sequence.
Return value
Example
#include <iostream> #include <span> int main() { constexpr char str[] = "ABCDEF\n"; const std::span sp{str}; for (auto n{sp.size()}; n != 2; --n) std::cout << sp.last(n).data(); }
Output:
ABCDEF BCDEF CDEF DEF EF F