std::ostream has no member function close()
. What type of stream should I not be allowed to close?
As an example, maybe I would like to close std::cout
in order to prevent any further writing to it.
std::cout.close(); // ‘std::ostream’ has no member named ‘close’
If I were using the C library, I could close stdout
with:
fclose(stdout); // no problem
So what is the idea behind leaving out the close()
member from std::ostream
?
Related: