[ispanstream.members]

# 31 Input/output library [[input.output]](./#input.output)

## 31.9 Span-based streams [[span.streams]](span.streams#ispanstream.members)

### 31.9.4 Class template basic_ispanstream [[ispanstream]](ispanstream#members)

#### 31.9.4.4 Member functions [ispanstream.members]

[ð](#lib:rdbuf,basic_ispanstream)

`basic_spanbuf<charT, traits>* rdbuf() const noexcept;
`

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L10535)

*Effects*: Equivalent to:return const_cast<basic_spanbuf<charT, traits>*>(addressof(*sb*));

[ð](#lib:span,basic_ispanstream)

`std::span<const charT> span() const noexcept;
`

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L10549)

*Effects*: Equivalent to: return rdbuf()->span();

[ð](#lib:span,basic_ispanstream_)

`void span(std::span<charT> s) noexcept;
`

[3](#3)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L10560)

*Effects*: Equivalent to rdbuf()->span(s)[.](#3.sentence-1)

[ð](#itemdecl:4)

`template<class ROS> void span(ROS&& s) noexcept;
`

[4](#4)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L10570)

*Constraints*: ROS models ranges​::​[borrowed_range](range.range#concept:borrowed_range "25.4.2 Ranges [range.range]")[.](#4.sentence-1)

(![convertible_to](concept.convertible#concept:convertible_to "18.4.4 Concept convertible_­to [concept.convertible]")<ROS, std​::​span<charT>>) && [convertible_to](concept.convertible#concept:convertible_to "18.4.4 Concept convertible_­to [concept.convertible]")<ROS, std​::​span<const charT>> is true[.](#4.sentence-2)

[5](#5)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L10576)

*Effects*: Let sp be std​::​span<const charT>(std​::​forward<ROS>(s))[.](#5.sentence-1)

Equivalent to:this->span(std::span<charT>(const_cast<charT*>(sp.data()), sp.size()));
