When I try to construct an ostream from cout, I get an error error: call to deleted constructor of 'std::basic_ostream<char>'
. Indeed, it is deleted in the ostream
header file: basic_ostream(const basic_ostream&) = delete;
.
What is the rationale behind this deletion - why not allow programmers to copy an ostream?
(I ask also because I want to understand, more generally, what is the rationale behind deleting constructors).