Mercurial > octave-nkf
diff src/oct-stream.h @ 3145:0d640dc625c7
[project @ 1998-02-05 08:44:59 by jwe]
author | jwe |
---|---|
date | Thu, 05 Feb 1998 08:45:07 +0000 |
parents | 66ef74ee5d9f |
children | 8cdcb8945695 |
line wrap: on
line diff
--- a/src/oct-stream.h Wed Feb 04 22:53:59 1998 +0000 +++ b/src/oct-stream.h Thu Feb 05 08:45:07 1998 +0000 @@ -93,11 +93,7 @@ bool ok (void) const { return (nconv >= 0); } - operator void* () const - { - return ok () - ? static_cast<void *> (-1) : static_cast<void *> (0); - } + operator bool () const { return ok (); } bool all_character_conversions (void); @@ -182,11 +178,7 @@ bool ok (void) const { return (nconv >= 0); } - operator void* () const - { - return ok () - ? static_cast<void *> (-1) : static_cast<void *> (0); - } + operator bool () const { return ok (); } private: @@ -265,6 +257,8 @@ virtual ostream *output_stream (void) { return 0; } + int fileno (void); + bool ok (void) const { return ! fail; } // Return current error message for this stream. @@ -418,13 +412,11 @@ return error (clear, err_num); } + int fileno (void) { return rep ? rep->fileno () : -1; } + bool ok (void) const { return rep && rep->ok (); } - operator void* () const - { - return ok () - ? static_cast<void *> (-1) : static_cast<void *> (0); - } + operator bool () const { return ok (); } string name (void);