X-Account-Key: account3
X-UIDL: AAA30mTAAAQSK0S9ZuS+0+U2PKRGS3/z
X-Mozilla-Status: 0001
X-Mozilla-Status2: 00000000
X-Mozilla-Keys: $label5                                                                         
Received: from mailgate.quovadx.com ([172.17.40.71]) by exchmail01.Blue.Roguewave.Com with Microsoft SMTPSVC(6.0.3790.1830);
	 Tue, 5 Feb 2008 19:00:43 -0700
Received: from brian.accu.org (brian.accu.org [146.227.57.6])
	by mailgate.quovadx.com (8.13.1/8.13.1) with ESMTP id m161xDi4010236
	for <sebor@roguewave.com>; Wed, 6 Feb 2008 01:59:24 GMT
Received: from brian.accu.org (localhost [127.0.0.1])
	by brian.accu.org (8.12.9/8.12.6) with ESMTP id m161peoj068480
	for <sebor@roguewave.com>; Wed, 6 Feb 2008 01:51:40 GMT
	(envelope-from c++std=lib@accu.org)
Received: (from mailnull@localhost)
	by brian.accu.org (8.12.9/8.12.6/Submit) with UUCP id m161peNp068479
	for sebor@roguewave.com; Wed, 6 Feb 2008 01:51:40 GMT
	(envelope-from c++std=lib@accu.org)
X-Authentication-Warning: brian.accu.org: mailnull set sender to c++std=lib@accu.org using -f
From: Martin Sebor <sebor@roguewave.com>
Errors-To: c++std-postmaster@accu.org
Reply-To: c++std-lib@accu.org
Sender: c++std=lib@accu.org
Precedence: list
Transport-Options: /ignore
Received: from vps.gnomedia.net (vps.gnomedia.net [207.58.171.244])
	by brian.accu.org (8.12.9/8.12.6) with ESMTP id m161kPoj068250
	for <c++std-lib@brian.accu.org>; Wed, 6 Feb 2008 01:46:25 GMT
	(envelope-from msebor@gmail.com)
Received: from rv-out-0910.google.com ([209.85.198.188])
	by vps.gnomedia.net with esmtp (Exim 4.68)
	(envelope-from <msebor@gmail.com>)
	id 1JMZIi-0000uf-Cm
	for c++std-lib@accu.org; Tue, 05 Feb 2008 20:42:18 -0500
Received: by rv-out-0910.google.com with SMTP id k20so1922052rvb.0
        for <c++std-lib@accu.org>; Tue, 05 Feb 2008 17:42:10 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=domainkey-signature:received:received:message-id:date:from:organization:user-agent:mime-version:to:subject:content-type:content-transfer-encoding:sender;
        bh=pZtdC8Nitk/ZqO16rES2JfcpZ2sO6AB+OR2VKjLPWE0=;
        b=G9FdDi4nnH4v4RZd3YSZ0L/wrRk+aVPoRJ/YtHGVLWdHS4S0iFV8BtGVCyKu9OccBU7URT36ixDVDlZAaAwW1b9UZ+leyb86r0Fl4oraXUIuv+9iW/2Ko111cq/VVwW3eEty1/xsVWdGu0Pwk0Ov0q44CZkXvMB5ILUtH+K2nYo=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=gamma;
        h=message-id:date:from:organization:user-agent:mime-version:to:subject:content-type:content-transfer-encoding:sender;
        b=CtqMhKlRl3WoI3sKr9SoQiL1p+s+NyKEq++3Ni2Y0UuEie4DxM6/Hnuf9WoqPgzoCYpKsm1svtVfcHoqR7eEv3Khzi0L+3au+LWlXef9qVnnIoAtb2uZdVdcoJMhfbUCMiOa3n5+NH+ABDUHzXQHVEOJ3YS3Cz59u2YEmsinKrA=
Received: by 10.141.22.1 with SMTP id z1mr6169933rvi.282.1202262130098;
        Tue, 05 Feb 2008 17:42:10 -0800 (PST)
Received: from localhost.localdomain ( [71.229.200.170])
        by mx.google.com with ESMTPS id 3sm9541130rvi.14.2008.02.05.17.42.08
        (version=TLSv1/SSLv3 cipher=RC4-MD5);
        Tue, 05 Feb 2008 17:42:09 -0800 (PST)
Message-ID: <47A9106E.606@roguewave.com>
Date: Tue, 05 Feb 2008 18:42:06 -0700
Organization: Rogue Wave Software, Inc.
User-Agent: Thunderbird 2.0.0.9 (X11/20071115)
MIME-Version: 1.0
Subject: ambiguity in [istream.iterator]
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Status: No, score=0.0 required=5.0 tests=AWL,BAYES_20,UNDISC_RECIPS,
	UNPARSEABLE_RELAY autolearn=disabled version=3.1.4
X-Spam-Score: -25
X-Spam-Bar: --
X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
X-AntiAbuse: Primary Hostname - vps.gnomedia.net
X-AntiAbuse: Original Domain - accu.org
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - gmail.com
To: undisclosed-recipients:;
X-Virus-Scanned: ClamAV 0.88.6/5702/Wed Feb  6 00:46:53 2008 on mailgate.quovadx.com
X-Virus-Status: Clean
X-Spam-Checker-Version: SpamAssassin 3.1.4 (2006-07-25) on 
	mailgate.quovadx.com
Return-Path: c++std=lib@accu.org
X-OriginalArrivalTime: 06 Feb 2008 02:00:43.0970 (UTC) FILETIME=[1513DA20:01C86864]

To: C++ libraries mailing list
Message c++std-lib-20221

The description of how an istream_iterator object becomes an
end-of-stream iterator is a) ambiguous and b) out of date WRT
issue 468:

   istream_iterator reads (using operator>>) successive elements
   from the input stream for which it was constructed. After it
   is constructed, and every time ++ is used, the iterator reads
   and stores a value of T. If the end of stream is reached
   (operator void*() on the stream returns false), the iterator
   becomes equal to the end-of-stream iterator value.

istream::operator void*() returns null if istream::fail() is true,
otherwise non-null. istream::fail() returns true if failbit or
badbit is set in rdstate(). Reaching the end of stream doesn't
necessarily imply that failbit or badbit is set (e.g., after
extracting an int from stringstream("123") the stream object will
have reached the end of stream but fail() is false and operator
void*() will return a non-null value).

Proposed fix:

   An object of type istream_iterator extracts (using operator>>)
   successive elements from the input stream for which it was
   constructed. After it is constructed, and every time operator++
   is called, the object extracts and stores a value of type T. If
   the end of stream is reached (calling eof() on the associated
   stream returns true), the object becomes the end-of-stream
   iterator.

Issue 468:
http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#468

