Member functions
Underlying buffer operations
Non-member functions
std::span<const CharT> span() const noexcept;
(1) (since C++23)
void span( std::span<CharT> s ) noexcept;
(2) (since C++23)
template< class ROS >
void span( ROS&& r ) noexcept;
(3) (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.
3) Same as (2), except that s is obtained as if by
std::span<const CharT> cs{std::forward<ROS>(r)};
std::span<CharT> s{const_cast<CharT*>(, cs.size()};

. This overload participates in overload resolution only if ROS models borrowed_range, std::convertible_to<ROS, std::span<CharT>> is false, and std::convertible_to<ROS, std::span<const CharT>> is true.


[edit] Parameters

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

[edit] 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-3) (none)

[edit] Example

[edit] See also

obtains or initializes an underlying buffer according to mode
(public member function of std::basic_spanbuf<CharT,Traits>) [edit]