220 18284 <CAA7U3HP9G8Q+bTY7sNyLX4u1i8-XZ6YS9jLUYsVYf885UfTUMg@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: Olaf van der Spek <olafvdspek@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Parsing Numbers
Date: Fri, 29 May 2015 09:22:03 +0200
Lines: 40
Approved: news@gmane.org
Message-ID: <CAA7U3HP9G8Q+bTY7sNyLX4u1i8-XZ6YS9jLUYsVYf885UfTUMg@mail.gmail.com>
References: <eb5c19d6-074f-4ee4-8e2d-6d92349eb4be@isocpp.org>
	<555CDDEF.8000002@gmx.net>
	<CAA7U3HMbniu0_RE2ptbwXzUrP9qRxQ_NG7=fBxytyobJ-X+=Sw@mail.gmail.com>
	<555ECB8E.9010606@gmx.net>
	<CAA7U3HPQ-FNKV3sci2n7+7Pk2kwg7wtUabAv=6aRXFsnOmCK_w@mail.gmail.com>
	<55680FE0.9050608@gmx.net>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
X-Trace: ger.gmane.org 1432884126 7803 80.91.229.3 (29 May 2015 07:22:06 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Fri, 29 May 2015 07:22:06 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBC5NB45SSABBBHFHUCVQKGQE3KHGRTQ@isocpp.org Fri May 29 09:22:05 2015
Return-path: <std-proposals+bncBC5NB45SSABBBHFHUCVQKGQE3KHGRTQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-wi0-f200.google.com ([209.85.212.200])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBC5NB45SSABBBHFHUCVQKGQE3KHGRTQ@isocpp.org>)
	id 1YyEcH-0001vI-Kn
	for gclcip-std-proposals@m.gmane.org; Fri, 29 May 2015 09:22:05 +0200
Original-Received: by wifx6 with SMTP id x6sf3063022wif.1
        for <gclcip-std-proposals@m.gmane.org>; Fri, 29 May 2015 00:22:05 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:mime-version:in-reply-to:references:date
         :message-id:subject:from:to:content-type:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe;
        bh=aTZKIcTd0bKqaEqP+tAOdzIu6hpunxX4/9c3m4PplTY=;
        b=BoFoFZVBIucg5a7X1MfMomi03sWRJu5uBt1k4NEj155q2gS0wdFYc3yPXeKMdDPlaw
         NUSuTZDOQDdExFjqIJLhgR/wUuIm3YrRdBECujjnutwVIyF+IxwrX6cEFVSt5JYj7zS6
         HrGuQmqe8GVMCqMkHv3VOu3IUFlSIO6TeEsTEdI16PLMTmnAMaaORRuN1L/+IuskHpS+
         zODf01Tg5B3jMihF2Onzp0VObskPGkooJErdRqpGJsy0CbULOjnZln/16ep8TiqYBgZ4
         mLzhhB+a/KkFgxvgCip7vZ4Y28wL5pOa+fBCrMei3h8NFzcvFYYQF9n1vQOo1lkv5/kH
         ktcA==
X-Gm-Message-State: ALoCoQmzln18tEvxIJohVv5bLup7LaJBvPvXHb5gIblJHIcckuHs61vu9Aa15qpO7EU6AKAfBz7M
X-Received: by 10.180.73.137 with SMTP id l9mr1736297wiv.5.1432884125101;
        Fri, 29 May 2015 00:22:05 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.180.102.71 with SMTP id fm7ls76831wib.29.gmail; Fri, 29 May
 2015 00:22:04 -0700 (PDT)
X-Received: by 10.180.76.100 with SMTP id j4mr3745606wiw.10.1432884124211;
        Fri, 29 May 2015 00:22:04 -0700 (PDT)
Original-Received: from mail-wg0-x230.google.com (mail-wg0-x230.google.com. [2a00:1450:400c:c00::230])
        by mx.google.com with ESMTPS id h5si8176270wjz.65.2015.05.29.00.22.04
        for <std-proposals@isocpp.org>
        (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Fri, 29 May 2015 00:22:04 -0700 (PDT)
Received-SPF: pass (google.com: domain of olafvdspek@gmail.com designates 2a00:1450:400c:c00::230 as permitted sender) client-ip=2a00:1450:400c:c00::230;
Original-Received: by wgme6 with SMTP id e6so54946019wgm.2
        for <std-proposals@isocpp.org>; Fri, 29 May 2015 00:22:04 -0700 (PDT)
X-Received: by 10.180.8.98 with SMTP id q2mr3637522wia.53.1432884124094; Fri,
 29 May 2015 00:22:04 -0700 (PDT)
Original-Received: by 10.28.48.18 with HTTP; Fri, 29 May 2015 00:22:03 -0700 (PDT)
In-Reply-To: <55680FE0.9050608@gmx.net>
X-Original-Sender: olafvdspek@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of olafvdspek@gmail.com designates 2a00:1450:400c:c00::230 as
 permitted sender) smtp.mail=olafvdspek@gmail.com;       dkim=pass
 header.i=@gmail.com;       dmarc=pass (p=NONE dis=NONE) header.from=gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Google-Group-Id: 399137483710
List-Post: <http://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:18284
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/18284>

2015-05-29 9:06 GMT+02:00 Jens Maurer <Jens.Maurer@gmx.net>:
>> Would this one work for you?
>> error_code parse(T&, string_view&, int base = 10);
>
> I prefer the iterator-style approach.  The style is well-established
> in the standard library, can be extended to more general iterators
> if someone feels so inclined (not me), has fewer issues with over-

Iterator-style is well-established indeed but range-style is more
convenient IMO.
Can't the string_view one be easily generalized too?

> eager aliasing assumptions that prevent compiler optimization,

I still don't get the aliasing problem. Isn't that only an issue with writes?
Wouldn't doing
auto it = is.begin();
auto last = is.end();
be enough?

> and can be made to look parallel with output.
> Output doesn't work
> with string_view at all, because its elements are const.

True, but IMO we should punish input for that.

> Regarding the aliasing assumptions: It's easy to say "that's the
> implementer's job", but I have been unable to coerce gcc into
> doing the right thing when examining similar style variations for
> output operations, even with gcc's __restrict extension.
> Maybe I'm just stupid.

-- 

--- 
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

.
