home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / gnu / g / help / 1186 < prev    next >
Encoding:
Text File  |  1992-09-03  |  1.5 KB  |  46 lines

  1. Newsgroups: gnu.g++.help
  2. Path: sparky!uunet!elroy.jpl.nasa.gov!ucla-cs!lanai.cs.ucla.edu!jason
  3. From: jason@lanai.cs.ucla.edu (Jason Rosenberg)
  4. Subject: I don't understand "operator void*()"
  5. Message-ID: <1992Sep4.005204.12632@cs.ucla.edu>
  6. Originator: jason@lanai.cs.ucla.edu
  7. Sender: usenet@cs.ucla.edu (Mr Usenet)
  8. Nntp-Posting-Host: lanai.cs.ucla.edu
  9. Organization: UCLA Computer Science Department
  10. Date: Fri, 4 Sep 92 00:52:04 GMT
  11. Lines: 33
  12.  
  13. I have a variable outStream declared as:
  14.  
  15. ostream outStream
  16.  
  17. When I try to do the comparison:  (outStream == cout)
  18.  
  19. It seems to return true when it shouldn't.  But what confuses me is that there
  20. really is no operator == for the stream types (derived from ios), but what 
  21. seems to get called while stepping through the debugger (gdb 4.4) is:
  22.  
  23. ios::operator void*()
  24.  
  25. I just don't understand why this operator is called.  Is the operator void*()
  26. a default operator for when the operator requested isn't found?  How would
  27. one make an explicit call to such an operator?
  28.  
  29. It could be that gdb simply isn't showing me the whole picture.  All I know
  30. is that when I set the breakpoint at the line with the comparison above and
  31. then step, the first place it stops at is the ios::operator void*().
  32.  
  33. Please enlighten me.
  34.  
  35. I know there are probably other things wrong with my code, but I just can't
  36. seem to understand the current dilemna.
  37.  
  38.  
  39. Jason
  40.  
  41.  
  42. -- 
  43. Jason Rosenberg                           Computer Science Department
  44. jason@cs.ucla.edu                         University of California
  45. {uunet,rutgers,ucbvax}!ucla-cs!jason      Los Angeles, CA  90024
  46.