GIDForums  

Go Back   GIDForums > Computer Programming Forums > C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 10-Jan-2006, 07:59
alcoholic's Avatar
alcoholic alcoholic is offline
Member
 
Join Date: Nov 2005
Posts: 170
alcoholic is on a distinguished road
Post

private copy and assignment operator


Can anyone tell me the practical reason why istream, ostream and iostream classes have made there objects uncopyable by making copy constructors and assignment operator private.
Or in general cases when would we don't want to allow users to copy.
__________________
Gravitation is not responsible for people falling in love.
-Albert Einstein
  #2  
Old 13-Jan-2006, 06:22
alcoholic's Avatar
alcoholic alcoholic is offline
Member
 
Join Date: Nov 2005
Posts: 170
alcoholic is on a distinguished road

Re: private copy and assignment operator


can anyone please look into this
__________________
Gravitation is not responsible for people falling in love.
-Albert Einstein
  #3  
Old 13-Jan-2006, 07:43
Guidelines Plz Guidelines Plz is offline
Junior Member
 
Join Date: Sep 2005
Posts: 87
Guidelines Plz is on a distinguished road

Re: private copy and assignment operator


It's your job to "look into" this. Our job is to answer if we know it, not do research for you.

Please refer to Guideline #7...
__________________

Please read http://www.gidforums.com/t-5566.html. They were written to help you create a request that is readable and has enough information we can actually tell what you need help with.
  #4  
Old 13-Jan-2006, 18:08
ubergeek ubergeek is offline
Regular Member
 
Join Date: Jan 2005
Posts: 775
ubergeek is a jewel in the roughubergeek is a jewel in the roughubergeek is a jewel in the rough

Re: private copy and assignment operator


well the iostream objects refer to hardware resources, such as the screen or files on the disk. if two objects referred to the same resource, race conditions could easily be created. This is just my guess of what is going on, but it sounds plausible (to me). Someone feel free to correct me if I'm wrong.
  #5  
Old 14-Jan-2006, 01:35
alcoholic's Avatar
alcoholic alcoholic is offline
Member
 
Join Date: Nov 2005
Posts: 170
alcoholic is on a distinguished road

Re: private copy and assignment operator


Quote:
Originally Posted by ubergeek
well the iostream objects refer to hardware resources, such as the screen or files on the disk. if two objects referred to the same resource, race conditions could easily be created. This is just my guess of what is going on, but it sounds plausible (to me). Someone feel free to correct me if I'm wrong.
Sounds a good reason to me too
__________________
Gravitation is not responsible for people falling in love.
-Albert Einstein
 
 

Recent GIDBlogDeveloping GUIs with wxPython (Part 3) by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Circular Linked Queue Copy Constructor and Assignment Operator Not Working? wc3promet C++ Forum 1 06-Oct-2008 03:00
Need of assignment operator in case of copy constructor alcoholic C++ Forum 2 01-Jan-2006 06:15
Pointer Usage in C++: Beginner to Advanced varunhome C++ Forum 0 19-Aug-2005 09:25
template comiling problems - need expert debugger! crq C++ Forum 1 01-Feb-2005 21:26

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 21:03.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.