220 18641 <mls1cn$bsr$1@ger.gmane.org> article
Path: news.gmane.org!not-for-mail
From: Matthew Woehlke <mw_triad@users.sourceforge.net>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Parsing Numbers
Date: Wed, 17 Jun 2015 10:48:54 -0400
Lines: 30
Approved: news@gmane.org
Message-ID: <mls1cn$bsr$1@ger.gmane.org>
References: <eb5c19d6-074f-4ee4-8e2d-6d92349eb4be@isocpp.org>	<b7762ff7-17e9-4ca8-a261-dd0c9c507d34@isocpp.org>	<8c6a8503-3958-4244-9d0f-33b567250056@isocpp.org>	<CAA7U3HPyaotZ=B9xg20C+H59O_kGqVXPnXn2UubJ9HC__Hz3TQ@mail.gmail.com>	<ce76204c-916d-4de4-a8cb-4470b8d1031d@isocpp.org>	<20150612225334.GA31968@noemi.bahnhof.se>	<ceb6f450-d84b-40c9-8c3e-931b7e1518c1@isocpp.org>	<557C3B5D.4070307@gmail.com>	<CAA7U3HNYP2CZACcLpQikg_wBNX=WKhmGHjTV1OdC7TkQHNq5dg@mail.gmail.com>	<557EE838.8030605@gmail.com>	<CAA7U3HNLcO70KxDtTZnMGqtM-F6-PpG6jygzM=XWMpWD=hLXeg@mail.gmail.com>	<557F93A8.3060708@gmail.com>	<CAA7U3HPJSgw3Ekh3uDPvkQYhsMmnj9pTXk_rj2tic9j4Ae_0oQ@mail.gmail.com>	<d3567976-4329-4f3f-9b3c-af11fd480e8c@isocpp.org> <CAA7U3HNe=VstgawwJm-pTgmWUF0NtD0oXPajK3Xb-18qjg=yvA@mail.gmail.com>
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 1434552608 13391 80.91.229.3 (17 Jun 2015 14:50:08 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Wed, 17 Jun 2015 14:50:08 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCO5FYHBU4ERB74RQ2WAKGQEVJMPFVA@isocpp.org Wed Jun 17 16:49:44 2015
Return-path: <std-proposals+bncBCO5FYHBU4ERB74RQ2WAKGQEVJMPFVA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-wg0-f70.google.com ([74.125.82.70])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCO5FYHBU4ERB74RQ2WAKGQEVJMPFVA@isocpp.org>)
	id 1Z5Eeo-0000Ly-ER
	for gclcip-std-proposals@m.gmane.org; Wed, 17 Jun 2015 16:49:38 +0200
Original-Received: by wgbhy7 with SMTP id hy7sf12985424wgb.3
        for <gclcip-std-proposals@m.gmane.org>; Wed, 17 Jun 2015 07:49:37 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:to:from:subject:date:lines:message-id:references
         :mime-version:content-type:user-agent:in-reply-to:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=87z1ZQJQQzD1hrjreV9z61v+FqFcL6ZpjQGWkC75kXI=;
        b=JrgjPMzCI7V+y6E5ZKrY+wPaBQ6i/9mFcXUFa2sr1CENBXzYLRehcLIPh5ursPlB4x
         DV37Qs8moIhlvq+LzrSsKFyubhALNK0Cfuo8NRpHtIhIk9y2SA9VAd3y8XV2T87hM03Y
         9cqqNcYXWGihfaG/paAO9xIINTpyy2/q7RO+skVB+Hv0L/kkoqv8StXQemrUyLZjTd2u
         P1tt8gNaX/rMVrsoTP43Z4j5orK1pD5qYDEB78A77yv69RPB7BcUpKnl6NQ+1xPj2sIJ
         wf/Mf21hv4bVbUoe+mDGtREU0jA/4pmyUbCYsCDsfOo8YQ70igLo1eF3aVZczrDtToP2
         
X-Gm-Message-State: ALoCoQliY1pBeQbI+r89Qe9c1Z2DzUvQXBAFdoEq9KvngivT76Buy1FOz9o2AKZRV4BGpvDwqFv+
X-Received: by 10.112.166.137 with SMTP id zg9mr5873373lbb.11.1434552575895;
        Wed, 17 Jun 2015 07:49:35 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.152.88.105 with SMTP id bf9ls309446lab.103.gmail; Wed, 17 Jun
 2015 07:49:34 -0700 (PDT)
X-Received: by 10.112.140.231 with SMTP id rj7mr8261266lbb.76.1434552574454;
        Wed, 17 Jun 2015 07:49:34 -0700 (PDT)
Original-Received: from plane.gmane.org (plane.gmane.org. [80.91.229.3])
        by mx.google.com with ESMTPS id qf8si3798676lbb.91.2015.06.17.07.49.34
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=RC4-SHA bits=128/128);
        Wed, 17 Jun 2015 07:49:34 -0700 (PDT)
Received-SPF: pass (google.com: domain of gclcip-std-proposals@m.gmane.org designates 80.91.229.3 as permitted sender) client-ip=80.91.229.3;
Original-Received: from list by plane.gmane.org with local (Exim 4.69)
	(envelope-from <gclcip-std-proposals@m.gmane.org>)
	id 1Z5EeO-0008L6-FE
	for std-proposals@isocpp.org; Wed, 17 Jun 2015 16:49:12 +0200
Original-Received: from tripoint.kitware.com ([66.194.253.20])
        by main.gmane.org with esmtp (Gmexim 0.1 (Debian))
        id 1AlnuQ-0007hv-00
        for <std-proposals@isocpp.org>; Wed, 17 Jun 2015 16:49:12 +0200
Original-Received: from mw_triad by tripoint.kitware.com with local (Gmexim 0.1 (Debian))
        id 1AlnuQ-0007hv-00
        for <std-proposals@isocpp.org>; Wed, 17 Jun 2015 16:49:12 +0200
X-Injected-Via-Gmane: http://gmane.org/
Original-Lines: 21
Original-X-Complaints-To: usenet@ger.gmane.org
X-Gmane-NNTP-Posting-Host: tripoint.kitware.com
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0
In-Reply-To: <CAA7U3HNe=VstgawwJm-pTgmWUF0NtD0oXPajK3Xb-18qjg=yvA@mail.gmail.com>
X-Original-Sender: mw_triad@users.sourceforge.net
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of gclcip-std-proposals@m.gmane.org designates 80.91.229.3 as
 permitted sender) smtp.mail=gclcip-std-proposals@m.gmane.org
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Spam-Checked-In-Group: 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:18641
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/18641>

On 2015-06-17 07:25, Olaf van der Spek wrote:
> I really think we should keep the proposal simple and worry about
> disallowing stuff later..
> 
> Though a parse_unsigned variant would allow one to build a strict
> parser oneselves.. and still be quite simple.

+1, that's what I was thinking as well... have an integer parser that
*only* parses digits (no prefix, *no sign allowed*). Use an unsigned
type so as to preserve maximum range. Maybe even base-10 only (i.e. have
both a base-10 optimized version and a user base - with no prefix
detection - version).

I'd like to also see standardized a more fully functional parser on top
of that, but I can relate to the points raised about needing to support
the simplest and fastest case. Probably this would detect and take note
of leading prefix characters (sign, base indicator) and call the
appropriate lower level function, then apply a sign transform if needed.

-- 
Matthew

-- 

--- 
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/.

.
