220 18583 <CAA7U3HPyaotZ=B9xg20C+H59O_kGqVXPnXn2UubJ9HC__Hz3TQ@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: Re: Parsing Numbers
Date: Fri, 12 Jun 2015 19:14:14 +0200
Lines: 61
Approved: news@gmane.org
Message-ID: <CAA7U3HPyaotZ=B9xg20C+H59O_kGqVXPnXn2UubJ9HC__Hz3TQ@mail.gmail.com>
References: <eb5c19d6-074f-4ee4-8e2d-6d92349eb4be@isocpp.org>
	<b7762ff7-17e9-4ca8-a261-dd0c9c507d34@isocpp.org>
	<8c6a8503-3958-4244-9d0f-33b567250056@isocpp.org>
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 1434129258 26378 80.91.229.3 (12 Jun 2015 17:14:18 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Fri, 12 Jun 2015 17:14:18 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBC5NB45SSABBBZ5G5SVQKGQEJQWMPVQ@isocpp.org Fri Jun 12 19:14:18 2015
Return-path: <std-proposals+bncBC5NB45SSABBBZ5G5SVQKGQEJQWMPVQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-wg0-f69.google.com ([74.125.82.69])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBC5NB45SSABBBZ5G5SVQKGQEJQWMPVQ@isocpp.org>)
	id 1Z3SX3-0005Gn-6u
	for gclcip-std-proposals@m.gmane.org; Fri, 12 Jun 2015 19:14:17 +0200
Original-Received: by wgez8 with SMTP id z8sf10868942wge.2
        for <gclcip-std-proposals@m.gmane.org>; Fri, 12 Jun 2015 10:14:16 -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:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=Ioaa2gTi/vM9GOT42avcHBpoeT+aFd+okuO53cSCQAs=;
        b=czcSKS3mWpcDjZwVWGXkysauNSZNcFPFtknYOGBs8UyLTyzcnwa8UTB5ny4L/bD8O4
         EWqiwqyRUS2f6wlk6HiD+r8LlIOHF8s8dxVXjfVOVMLlyPuR/0/c5BkJrtPrGZUC9Aky
         2GhsG/TqIRILMw/4zJAPkcLjoEORSUV2PNfLisjLwYoPf6eoNFe2qk5A2TcU/09KJriI
         PAw8Wns1Yxnn/vkhtVujgGleZphTzhA8pMdIRiyn8Nu+EwUI1u3T45DnE6n71P3yTn/a
         Jct04S4INi7kX5SAxwBcos+v5qD60mtG3cekYWp+hRnaRm2i9apQ1r/WGgro3bAZq5U4
         cxRA==
X-Gm-Message-State: ALoCoQlsnqPIfx/QuBRH8M6qpJFDP5r0W23fJqdHCDsreXCdIHodl3aJKlT03Mb2TPDL0ssOmA0A
X-Received: by 10.194.158.134 with SMTP id wu6mr15250222wjb.6.1434129256602;
        Fri, 12 Jun 2015 10:14:16 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.180.94.69 with SMTP id da5ls217683wib.8.canary; Fri, 12 Jun
 2015 10:14:15 -0700 (PDT)
X-Received: by 10.180.87.199 with SMTP id ba7mr8975474wib.81.1434129255071;
        Fri, 12 Jun 2015 10:14:15 -0700 (PDT)
Original-Received: from mail-wi0-x22a.google.com (mail-wi0-x22a.google.com. [2a00:1450:400c:c05::22a])
        by mx.google.com with ESMTPS id ht6si4424552wib.102.2015.06.12.10.14.15
        for <std-proposals@isocpp.org>
        (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Fri, 12 Jun 2015 10:14:15 -0700 (PDT)
Received-SPF: pass (google.com: domain of olafvdspek@gmail.com designates 2a00:1450:400c:c05::22a as permitted sender) client-ip=2a00:1450:400c:c05::22a;
Original-Received: by wifx6 with SMTP id x6so22927019wif.0
        for <std-proposals@isocpp.org>; Fri, 12 Jun 2015 10:14:14 -0700 (PDT)
X-Received: by 10.180.109.111 with SMTP id hr15mr8932320wib.53.1434129254585;
 Fri, 12 Jun 2015 10:14:14 -0700 (PDT)
Original-Received: by 10.28.48.18 with HTTP; Fri, 12 Jun 2015 10:14:14 -0700 (PDT)
In-Reply-To: <8c6a8503-3958-4244-9d0f-33b567250056@isocpp.org>
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:c05::22a 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-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:18583
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/18583>

2015-06-12 17:49 GMT+02:00 Matthew Fioravante <fmatthew5876@gmail.com>:
>
>
> On Friday, June 12, 2015 at 9:51:55 AM UTC-4, Olaf van der Spek wrote:
>>
>> Some more Qs:
>> Should (unsigned) short be supported?
>>
>> Should (unsigned) char be supported?
>
>
> I would support all integral types. I also believe unsigned types should be
> supported because if you really want that high order bit without triggering
> an overflow error you can't use a signed type.

Of course

> I would also make it an error
> to try to specify a negative literal (i.e. '-' prefix) if T is unsigned
> integral.

What about "-0"?
"+1"?

>>
>> Bool?
>
>
> This is tricky because valid strings could be (0, 1), (true, false), (True,
> False), (T,F), etc.... If the parsing function is named something like
> str_to_num() then it makes sense to support bool with "0" and "1". If its
> more generic like parse(), then the question of valid inputs becomes more
> ambiguous.

True
There's also the question of what to do with for example -1 and 2. Map
to true or return invalid input?

>> Should octal input be supported if base = 0?
>
>
> I would at minimum support all of the literals supported by the core
> language string literals. That is, hex (0x), decimal (), octal (0), and
> binary (0b).

Does strtol support 0b?
0 as prefix is problematic as 09 for example is probably not intended
as an octal number.


-- 
Olaf

-- 

--- 
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/.

.
