CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1

    Why copy constructor of ostream class is private?

    Why copy constructor of ostream class is private?

  2. #2
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    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.

  3. #3

    Re: Why copy constructor of ostream class is private?

    Can someone more light on this?

  4. #4
    Join Date
    Mar 2002
    Location
    Kent, United Kingdom
    Posts
    399

    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 ?
    your humble savant

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured