std::basic_osyncstream<CharT,Traits,Allocator>::operator=
Min standard notice:
Move-assigns a synchronized output stream:
# Declarations
basic_osyncstream& operator=( std::basic_osyncstream&& other );
(since C++20)
# Parameters
other: another synchronized output stream to move from
# Return value
*this
# Example
#include <iomanip>
#include <iostream>
#include <sstream>
#include <syncstream>
#include <utility>
int main()
{
std::osyncstream out(std::cout);
out << "test\n";
std::ostringstream str_out;
std::osyncstream{str_out} = std::move(out); // Note that out is emitted here
std::cout << "str_out = " << std::quoted(str_out.view()) << '\n';
}
# Defect reports
| DR | Applied to | Behavior as published | Correct behavior |
|---|---|---|---|
| LWG 3867 | C++20 | the move assignment operator was noexcept, butstd::basic_syncbuf’s move assignment operator is not | removed noexcept |