# std::basic_spanstream<CharT,Traits>::span

From cppreference.com
< cpp‎ | io‎ | basic spanstream

std::span<CharT> span() const noexcept; | (1) | (since C++23)
void span( std::span<CharT> s ) noexcept; | (2) | (since C++23)

1) Gets a `span` referencing the written area if std::ios_base::out is set in the open mode of the wrapped std::basic_spanbuf, or a `span` referencing the underlying buffer otherwise.
2) Makes the wrapped std::basic_spanbuf perform I/O on the buffer referenced by `s`.

### Parameters

s | - | std::span referencing the storage to be use as the new underlying buffer of stream

### Return value

1) A std::span referencing the underlying buffer or written area, depending on the open mode of the wrapped std::basic_spanbuf.
2) (none)

### Example

| This section is incomplete Reason: no example

### See also

span (C++23) | obtains or initializes an underlying buffer according to mode (public member function of `std::basic_spanbuf<CharT,Traits>`)

Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/io/basic_spanstream/span&oldid=130880"