cplusplus.com cplusplus.com
cplusplus.com   C++ : Reference : IOstream Library : ios : operatornot
- -
C++
Information
Documentation
Reference
Articles
Sourcecode
Forum
Reference
C Library
IOstream Library
Strings library
STL Containers
STL Algorithms
IOstream Library
manipulators
classes:
· filebuf
· fstream
· ifstream
· ios
· iostream
· ios_base
· istream
· istringstream
· ofstream
· ostream
· ostringstream
· streambuf
· stringbuf
· stringstream
objects:
· cerr
· cin
· clog
· cout
types:
· fpos
· streamoff
· streampos
· streamsize
ios
· ios::ios
· ios::~ios
member functions:
· ios::bad
· ios::clear
· ios::copyfmt
· ios::eof
· ios::exceptions
· ios::fail
· ios::fill
· ios::good
· ios::imbue
· ios::init
· ios::narrow
· ios::operator!
· ios::operator void*
· ios::rdbuf
· ios::rdstate
· ios::setstate
· ios::tie
· ios::widen

-

ios::operator! public member function
bool operator ! ( ) const;

Evaluate stream object

Returns true if either one of the error flags (failbit or badbit) is set on the stream. Otherwise it returns false.

This behavior is equivalent to the member function fail().

Parameters

none

Return Value

true if either failbit or badbit is set.
false otherwise.

Example

// evaluating a stream object
#include <iostream>
#include <fstream>
using namespace std;

int main () {
  ifstream is;
  is.open ("test.txt");
  if (!is)
    cerr << "Error opening 'test.txt'\n";
  return 0;
}

Basic template member declaration

( basic_ios<charT,traits> )
bool operator ! () const;

See also

ios::fail Check if either failbit or badbit is set (public member function)
ios::good Check if the state of the stream is good for i/o operations. (public member function)

© The C++ Resources Network, 2000-2007 - All rights reserved
Spotted an error? - contact us