Re: Why copy constructor of ostream class is private?
Because it wouldn't make much sense to copy an ostream. Let's say you do. Now, how are writes to the two copies of the stream supposed to resolve themselves? They'd be constantly overwriting each other.
Re: Why copy constructor of ostream class is private?
It is made private so you can't copy it.
As Lindley said, there is no sense in having two ostreams.
What use would there be in having two items doing the same job ?
How would they sort out which is supposed to be doing the work at any particular time ?
Bookmarks