220 18137 <mjnd3s$ugg$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: Fri, 22 May 2015 10:05:48 -0400
Lines: 35
Approved: news@gmane.org
Message-ID: <mjnd3s$ugg$1@ger.gmane.org>
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> <CAA7U3HOc-tuXk9LPL4ce55Ce0XYn_M6q6L5ir-x8QiBevLvh1Q@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 1432303572 32449 80.91.229.3 (22 May 2015 14:06:12 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Fri, 22 May 2015 14:06:12 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCO5FYHBU4ERBRPP7SVAKGQENQZUV7Y@isocpp.org Fri May 22 16:06:03 2015
Return-path: <std-proposals+bncBCO5FYHBU4ERBRPP7SVAKGQENQZUV7Y@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-lb0-f200.google.com ([209.85.217.200])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCO5FYHBU4ERBRPP7SVAKGQENQZUV7Y@isocpp.org>)
	id 1YvnaK-0000xc-2T
	for gclcip-std-proposals@m.gmane.org; Fri, 22 May 2015 16:06:00 +0200
Original-Received: by lbbqj7 with SMTP id qj7sf5367206lbb.1
        for <gclcip-std-proposals@m.gmane.org>; Fri, 22 May 2015 07:05:59 -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:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe;
        bh=g/+tt2S91qmQsLKWwJxeabpvC7JDyE+WQLJExlOBS9o=;
        b=OxNjF4khsPHyMIZMzBZtH26T+owL24+0SNlYO33SJfqXgjJMZAZIqyEVWfq4e6Gltq
         kyLgn089u9QQ4cNsFFRT//SP0Kwrf0FhSwZRTKjgOMl2sYi/nLp5UK58Bu4rVZR50mFC
         nBsYbM2Vcip82ESX0wd2Z0K3xL5QR6KVeasqmL5+mUzOWBG4m5kln4n3Ejc8nbBlvY1g
         0UohvrrpCw98UZLdAorVYqFJwKIJsOdightoKpDEJs87xQMZf5XPB2aOcTGhio2qJmC1
         5FJLouip/BHu6pBCGftKYZ5ay2COvyDxob2RLbn43Qi1b2OeTRMT4Oifnmw5UbBlcMEY
         DzWw==
X-Gm-Message-State: ALoCoQn3yU4BpqOHUuZ7IeqDfSuD7AFnBpj2Yp2c3RjBp/7jkKKbmzACOq27jDDGDaQHf7fErbqE
X-Received: by 10.112.219.200 with SMTP id pq8mr7981819lbc.7.1432303559668;
        Fri, 22 May 2015 07:05:59 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.152.37.105 with SMTP id x9ls514252laj.11.gmail; Fri, 22 May
 2015 07:05:57 -0700 (PDT)
X-Received: by 10.152.3.97 with SMTP id b1mr6653493lab.54.1432303557256;
        Fri, 22 May 2015 07:05:57 -0700 (PDT)
Original-Received: from plane.gmane.org (plane.gmane.org. [80.91.229.3])
        by mx.google.com with ESMTPS id sw10si1448947lbb.158.2015.05.22.07.05.56
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=RC4-SHA bits=128/128);
        Fri, 22 May 2015 07:05:56 -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 1YvnaD-0000st-Ud
	for std-proposals@isocpp.org; Fri, 22 May 2015 16:05:54 +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>; Fri, 22 May 2015 16:05:53 +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>; Fri, 22 May 2015 16:05:53 +0200
X-Injected-Via-Gmane: http://gmane.org/
Original-Lines: 26
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.5.0
In-Reply-To: <CAA7U3HOc-tuXk9LPL4ce55Ce0XYn_M6q6L5ir-x8QiBevLvh1Q@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-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:18137
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/18137>

On 2015-05-22 04:25, Olaf van der Spek wrote:
> 2015-05-22 8:24 GMT+02:00 Jens Maurer <Jens.Maurer@gmx.net>:
>> My focus here is to make the low-level functions available to
>> users.  I'm not against providing some high-level functions, too.
>> (The C++ standard currently does not offer low-level functions;
>> strtoul is locale-dependent, which slows it down substantially.
>> See also N4412.)
> 
> Right, locales..
> Should a locale-aware variant be provided?
> A locale-unaware one?
> Both?
> Should the locale be a parameter?

IMHO, yes (both). Locale-aware because dealing with locales is hard, and
we should not require the user to do this. ASCII-only because there will
be cases where that is all that is needed (reading machine-written data)
and because the performance is much, much faster.

I would probably go with something like 'parse(...)' (ASCII-only) and
'parse_l(..., std::locale* = nullptr)' which uses the current locale if
none is provided (and possibly falls back on the fast ASCII-only if the
locale is 'C').

-- 
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/.

.
