29 Input/output library [input.output]

29.9 Span-based streams [span.streams]

29.9.5 Class template basic_­ospanstream [ospanstream]

29.9.5.1 General [ospanstream.general]

namespace std { template<class charT, class traits = char_traits<charT>> class basic_ospanstream : public basic_ostream<charT, traits> { public: using char_type = charT; using int_type = typename traits::int_type; using pos_type = typename traits::pos_type; using off_type = typename traits::off_type; using traits_type = traits; // [ospanstream.ctor], constructors explicit basic_ospanstream(std::span<charT> s, ios_base::openmode which = ios_base::out); basic_ospanstream(const basic_ospanstream&) = delete; basic_ospanstream(basic_ospanstream&& rhs); // [ospanstream.assign], assignment and swap basic_ospanstream& operator=(const basic_ospanstream&) = delete; basic_ospanstream& operator=(basic_ospanstream&& rhs); void swap(basic_ospanstream& rhs); // [ospanstream.members], member functions basic_spanbuf<charT, traits>* rdbuf() const noexcept; std::span<charT> span() const noexcept; void span(std::span<charT> s) noexcept; private: basic_spanbuf<charT, traits> sb; // exposition only }; template<class charT, class traits> void swap(basic_ospanstream<charT, traits>& x, basic_ospanstream<charT, traits>& y); }