I find it impossible to create an extractor (operator>>) to work with a data
type that I define myself. Specifically, after I program a
(for example) I would like to enable reading an instance of Number using the
familiar extractor syntax, ie
cin >> num;
My problem is that inside my extractor operator
istream& operator>> (istream& ist, Number& num);
I would like to call
when I encounter garbage reading stream ist. Guess what. ios::setstate() is
protected. So I can't call it!
I propose that a public method ios::setfail(void) be added to class ios which
simply calls ios::setstate(ios::failbit).
I find that the iostream package is moderately awkward to use and extremely
difficult to extend. Since C++ is supposed to be object oriented, I'm very
disappointed. I hope that the ANSI committee will consider standardizing the
iostream library, and making it easier to extend.
David Arnstein | What do you mean, "get a life"?