This works because of two properties of istream objects:
- istreams are returned after each retrieval (operator
>>) to allow a chain of multiple selections ( a >> b >> c) - istreams return their status (as if called
.good()) when they were translated / converted to bool, overloadingbool operator !()
, , :
if ( ((((ibuf >> zork) >> ia) >> Comma) >> ib).good() ) {
}
, if (ibuf), if ((bool)ibuf), ibuf.good().
, , , , gcount. , , get getline, .