| I/O manipulators | ||||
| Print functions(C++23) | ||||
| C-style I/O | ||||
| Buffers | ||||
(C++23) | ||||
(C++98/26*) | ||||
(C++20) | ||||
| Streams | ||||
| Abstractions | ||||
| File I/O | ||||
| String I/O | ||||
| Array I/O | ||||
(C++23) | ||||
(C++23) | ||||
(C++23) | ||||
(C++98/26*) | ||||
(C++98/26*) | ||||
(C++98/26*) | ||||
| Synchronized Output | ||||
(C++20) | ||||
| Types | ||||
| Error category interface | ||||
(C++11) | ||||
(C++11) |
explicit basic_ospanstream(std::span<CharT> s,std::ios_base::openmode mode= std::ios_base::out); | (1) | (since C++23) |
basic_ospanstream( basic_ospanstream&& rhs); | (2) | (since C++23) |
basic_ospanstream(const basic_ospanstream&)= delete; | (3) | (since C++23) |
Constructs a newbasic_ospanstream.
basic_ospanstream is not copyable.Contents |
| s | - | std::span referencing the storage to be use as initial underlying buffer of stream | ||||||||||||||||
| mode | - | specifies stream open mode. Following constants and bit-wise OR between them may be used:
| ||||||||||||||||
| other | - | anotherbasic_ospanstream to be moved from |
May throw implementation-defined exceptions.
#include <array>#include <iostream>#include <spanstream> int main(){std::array<char,10> buffer;std::ospanstream os(buffer); os<<"i="<<1<<" j="<<2<<'\n'<<std::ends; std::cout<< buffer.data();}
Output:
i=1 j=2
constructs abasic_spanbuf object(public member function of std::basic_spanbuf<CharT,Traits>)[edit] |