Newsgroups: comp.lang.c++ Path: utzoo!henry From: henry@utzoo.uucp (Henry Spencer) Subject: Re: The >> operator Message-ID: <1989Feb24.200919.15728@utzoo.uucp> Organization: U of Toronto Zoology References: <6622@phoenix.Princeton.EDU> Date: Fri, 24 Feb 89 20:09:19 GMT In article <6622@phoenix.Princeton.EDU> levy@fine.UUCP (Silvio Levy) writes: >... I'm not very happy with the fact that when something like > >cin >> i; // i is an int > >fails (say because the next character is not a digit) the stream's >_fail flag gets set... Is this the best possible design for >> ? Possibly not. It's not clear that it matters that much, though. If one is being seriously paranoid about input format, i.e. one is expecting input typed by humans, one almost invariably ends up reading in a whole line and then picking it apart in memory. Formatted-input primitives just are not terribly useful when erroneous input is a serious issue; they *never* seem to provide enough hooks for good error handling. -- The Earth is our mother; | Henry Spencer at U of Toronto Zoology our nine months are up. | uunet!attcan!utzoo!henry henry@zoo.toronto.edu