How does std::cin return a bool value?
For instance you can write
Code:
 if(std::cin) { ... }
to check the fail state of std::cin. But how does that work, if std::cin is an object of istream?

Also how do std::cout << "blah" << "blah"; and std::cin >> var >> var2; return bool values? The insertion operator must return ostream object so that cascading works right..

Can I do something similar with my user-defined class?