Return-Path: Delivered-To: apmail-incubator-stdcxx-dev-archive@www.apache.org Received: (qmail 41665 invoked from network); 7 Nov 2007 15:50:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Nov 2007 15:50:45 -0000 Received: (qmail 59168 invoked by uid 500); 7 Nov 2007 15:50:33 -0000 Delivered-To: apmail-incubator-stdcxx-dev-archive@incubator.apache.org Received: (qmail 59104 invoked by uid 500); 7 Nov 2007 15:50:33 -0000 Mailing-List: contact stdcxx-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: stdcxx-dev@incubator.apache.org Delivered-To: mailing list stdcxx-dev@incubator.apache.org Received: (qmail 59093 invoked by uid 99); 7 Nov 2007 15:50:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Nov 2007 07:50:33 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of msebor@gmail.com designates 64.233.170.190 as permitted sender) Received: from [64.233.170.190] (HELO rn-out-0102.google.com) (64.233.170.190) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Nov 2007 15:50:35 +0000 Received: by rn-out-0102.google.com with SMTP id e24so1049532rng for ; Wed, 07 Nov 2007 07:50:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:organization:user-agent:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; bh=3T/zi+fggmH5WghgWE86/7uA+4LimYh7JCzfG53NNGE=; b=fUEG+tqqnXjnxQ+oMSEOUdOvlqn7pTt3t2MMRgIhqYWnL0oARjEwmI4svJ2zcDGEUOMsFusZx2sRmi8f9bgKezj+OsoqGWRPqCLqVn2dI1jZeUw9Mn/8qbz+GQ89krQpbnXHEJd76X5fPnHBwuKS6821dUdmBjLDk/HuuqYNP1c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:organization:user-agent:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; b=dvGHGZ9dPjjrcf8nLGA8aLZWcmjkLmVXmc9G7S0Anir+N9E64HjCjZWP9KB1jBB1AyfvOzZ5pvV4ewXNgqC7QuMTVrJQLHNhQGhdYE9sX15a0040nq8El1VCduBFBCBQVoKsrP1Raog9mpvjc+zzhiw9+xNmJmjju0CTV1Qiqb4= Received: by 10.142.163.14 with SMTP id l14mr2103951wfe.1194450613696; Wed, 07 Nov 2007 07:50:13 -0800 (PST) Received: from ?192.168.1.104? ( [71.229.200.170]) by mx.google.com with ESMTPS id g36sm8877783rob.2007.11.07.07.50.12 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 07 Nov 2007 07:50:12 -0800 (PST) Message-ID: <4731DEB1.8070901@roguewave.com> Date: Wed, 07 Nov 2007 08:50:09 -0700 From: Martin Sebor Organization: Rogue Wave Software, Inc. User-Agent: Thunderbird 1.5.0.12 (X11/20071019) MIME-Version: 1.0 To: stdcxx-dev@incubator.apache.org Subject: Re: another istream_iterator question References: <472CB093.5060105@gmail.com> In-Reply-To: <472CB093.5060105@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: Martin Sebor X-Virus-Checked: Checked by ClamAV on apache.org Mark Brown wrote: > I have been looking at the istream_iterator class, mostly out of > curiosity than to try to fix a specific bug, to see if there are > any other discrepancies with the standard and operator++ caught > my attention. The standard says that the operator should return > *in_stream >> value but the stdcxx definition looks like this: > > istream_iterator& operator++ () { > return _C_strm && !!*_C_strm && (*_C_strm >> _C_val), *this; > } > > There are two extra checks that aren't required by the standard. > They are probably harmless but I wonder if they shouldn't be > removed for efficiency. Does anyone see a problem with such > a change? I see no problem with it. We should assert that _C_strm is non-null before dereferencing it but other than that I see no reason to try to prevent undefined behavior (the effects of operator++ are undefined once the iterator has reached the end of the sequence). Martin > > --Mark >