[ispanstream.cons] # 31 Input/output library [[input.output]](./#input.output) ## 31.9 Span-based streams [[span.streams]](span.streams#ispanstream.cons) ### 31.9.4 Class template basic_ispanstream [[ispanstream]](ispanstream#cons) #### 31.9.4.2 Constructors [ispanstream.cons] [🔗](#lib:basic_ispanstream,constructor) `explicit basic_ispanstream(std::span s, ios_base::openmode which = ios_base::in); ` [1](#1) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L10455) *Effects*: Initializes the base class withbasic_istream(addressof(*sb*)) and *sb* withbasic_spanbuf(s, which | ios_base​::​in) ([[spanbuf.cons]](spanbuf.cons "31.9.3.2 Constructors"))[.](#1.sentence-1) [🔗](#lib:basic_ispanstream,constructor_) `basic_ispanstream(basic_ispanstream&& rhs); ` [2](#2) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L10469) *Effects*: Initializes the base class with std​::​move(rhs) and *sb* with std​::​move(rhs.*sb*)[.](#2.sentence-1) Next, basic_istream​::​set_rdbuf(addressof(*sb*)) is called to install the contained basic_spanbuf[.](#2.sentence-2) [🔗](#lib:basic_ispanstream,constructor__) `template explicit basic_ispanstream(ROS&& s) ` [3](#3) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L10483) *Constraints*: ROS models ranges​::​[borrowed_range](range.range#concept:borrowed_range "25.4.2 Ranges [range.range]")[.](#3.sentence-1) ![convertible_to](concept.convertible#concept:convertible_to "18.4.4 Concept convertible_­to [concept.convertible]")> && [convertible_to](concept.convertible#concept:convertible_to "18.4.4 Concept convertible_­to [concept.convertible]")> is true[.](#3.sentence-2) [4](#4) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L10489) *Effects*: Let sp be std​::​span(std​::​forward(s))[.](#4.sentence-1) Equivalent to:basic_ispanstream(std::span(const_cast(sp.data()), sp.size()))