Daily bit(e) of C++ | std::spanstream
Daily bit(e) of C++ #78, The C++23 std::stringstream alternative for borrowed contiguous ranges: std::spanstream
The C++23 added the std::spanstream
, effectively a std::stringstream
equivalent operating on a borrowed contiguous range.
std::spanstream
can be used to directly parse text stored in raw memory, string views or string literals.
When using std::spanstream
for writing, the std::spanstream
will write as much output as fits into the output span, which can be inconvenient.