🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Jason Rosenberg Fri, 04 Sep 1992 00:52
I don't understand "operator void*()"
#174
Author: Jason Rosenberg
Date: Fri, 04 Sep 1992 00:52
33 lines
1628 bytes
I have a variable outStream declared as:

ostream outStream

When I try to do the comparison:  (outStream == cout)

It seems to return true when it shouldn't.  But what confuses me is that there
really is no operator == for the stream types (derived from ios), but what 
seems to get called while stepping through the debugger (gdb 4.4) is:

ios::operator void*()

I just don't understand why this operator is called.  Is the operator void*()
a default operator for when the operator requested isn't found?  How would
one make an explicit call to such an operator?

It could be that gdb simply isn't showing me the whole picture.  All I know
is that when I set the breakpoint at the line with the comparison above and
then step, the first place it stops at is the ios::operator void*().

Please enlighten me.

I know there are probably other things wrong with my code, but I just can't
seem to understand the current dilemna.


Jason


-- 
Jason Rosenberg                           Computer Science Department
jason@cs.ucla.edu                         University of California
{uunet,rutgers,ucbvax}!ucla-cs!jason      Los Angeles, CA  90024
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads