220 18581 <8c6a8503-3958-4244-9d0f-33b567250056@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: Matthew Fioravante <fmatthew5876@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Parsing Numbers
Date: Fri, 12 Jun 2015 08:49:20 -0700 (PDT)
Lines: 102
Approved: news@gmane.org
Message-ID: <8c6a8503-3958-4244-9d0f-33b567250056@isocpp.org>
References: <eb5c19d6-074f-4ee4-8e2d-6d92349eb4be@isocpp.org>
 <b7762ff7-17e9-4ca8-a261-dd0c9c507d34@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_528_1549752212.1434124160583"
X-Trace: ger.gmane.org 1434124164 26582 80.91.229.3 (12 Jun 2015 15:49:24 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Fri, 12 Jun 2015 15:49:24 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDELF54RTIGRBAP75OVQKGQEZZSPQEA@isocpp.org Fri Jun 12 17:49:23 2015
Return-path: <std-proposals+bncBDELF54RTIGRBAP75OVQKGQEZZSPQEA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ie0-f200.google.com ([209.85.223.200])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDELF54RTIGRBAP75OVQKGQEZZSPQEA@isocpp.org>)
	id 1Z3RCt-0002s3-AC
	for gclcip-std-proposals@m.gmane.org; Fri, 12 Jun 2015 17:49:23 +0200
Original-Received: by ierg5 with SMTP id g5sf64414017ier.2
        for <gclcip-std-proposals@m.gmane.org>; Fri, 12 Jun 2015 08:49:22 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :content-type:x-original-sender:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=CRf2+0x9ExcNo5RexD3vchYntKJsesx3rTD/Rt0ekW4=;
        b=PSOKNJeW2H/I6kA3ROJPRAPUFosNIcNVhfjB131o6G+qhAyOtlPxyWhum+6ROA4SUG
         SyzPcaDvXNyyutIYXCpT1eRARWOuYTfG/FQC15giw3ezaFaY5cdiX7e8zi68/EXge+hi
         L/O0iNBKVSxJhyqyAJob3Gr5nD9eZgFzOqhY2kydk5FMWKNnPcwJOn7QFboqCfUdochC
         2yVrJEcf4LzSf3+1zrtzpkEhh9dq0hqpU6CalSYNv3NUPJNj+/lcd7RZriuHD0AMNRpb
         8BM/xiASW9cT/sWtpiU1JuwsgT2gqO7P20Kwl78akNA3icxXdKpBCWO7FIJVjKZfkVTk
         Q9RQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:date:from:to:message-id:in-reply-to:references
         :subject:mime-version:content-type:x-original-sender:reply-to
         :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post
         :list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=CRf2+0x9ExcNo5RexD3vchYntKJsesx3rTD/Rt0ekW4=;
        b=J8KAVyQT3nXlZ9YkO45d9JG3V0fArMKn0IWLG4GARy/4XB1wDDwKd780MSsb4lUaaQ
         BAt72GfhcQtYkWLNX5+gwQaaQYy+5mwVzh8sghHGWTRH2RDnMS6BBl8H8Hgn/vYMaDZy
         Jd8eqFsBX5gTU1PF1A7KfiqqDOEzoYsj6e93CnO5bw/xy2w+oVipAg3ifvXVqvA/XRJb
         5aRT1xcGWzoPypphuq0lQSJh8xFgiwiserybbAeh1uu+uK9dh6TrIUKD2+vMj6IQz0At
         qdEnGPIrwqhwGJtGvTZmyGsBxt1lFevQMW/EcgvFPeF0V02FHR/RyPriPAepkst1QAQO
         taFA==
X-Gm-Message-State: ALoCoQmFSG38BgZfoJOetwuByPC0xzVcnhXW9ypKgsEq0Cfps8IJAle1aliOl6a3Efk7u0LoH7IZ
X-Received: by 10.182.243.226 with SMTP id xb2mr18883998obc.50.1434124162204;
        Fri, 12 Jun 2015 08:49:22 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.140.42.81 with SMTP id b75ls2532189qga.50.gmail; Fri, 12 Jun
 2015 08:49:21 -0700 (PDT)
X-Received: by 10.140.83.165 with SMTP id j34mr99373qgd.23.1434124161552;
        Fri, 12 Jun 2015 08:49:21 -0700 (PDT)
In-Reply-To: <b7762ff7-17e9-4ca8-a261-dd0c9c507d34@isocpp.org>
X-Original-Sender: fmatthew5876@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:18581
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/18581>

------=_Part_528_1549752212.1434124160583
Content-Type: multipart/alternative; 
	boundary="----=_Part_529_2003756268.1434124160583"

------=_Part_529_2003756268.1434124160583
Content-Type: text/plain; charset=UTF-8



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. I would also make it an 
error to try to specify a negative literal (i.e. '-' prefix) if T is 
unsigned integral.
 

> 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.

 
>

> 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).

-- 

--- 
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/.

------=_Part_529_2003756268.1434124160583
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>On Friday, June 12, 2015 at 9:51:55 AM UTC-4, Olaf=
 van der Spek wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0pt =
0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex=
;"><div dir=3D"ltr"><div>Some more Qs:</div><div>Should (unsigned) short be=
 supported?</div></div></blockquote><blockquote class=3D"gmail_quote" style=
=3D"margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); p=
adding-left: 1ex;"><div dir=3D"ltr">Should (unsigned) char be supported?</d=
iv></blockquote><div><br>I would support all integral types. I also believe=
 unsigned types should be supported because if you really want that high or=
der bit without triggering an overflow error you can't use a signed type. I=
 would also make it an error to try to specify a negative literal (i.e. '-'=
 prefix) if T is unsigned integral.<br>&nbsp;</div><blockquote class=3D"gma=
il_quote" style=3D"margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(20=
4, 204, 204); padding-left: 1ex;"><div dir=3D"ltr"><div>Bool?<br></div></di=
v></blockquote><div><br>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 i=
nputs becomes more ambiguous.<br><br></div><blockquote class=3D"gmail_quote=
" style=3D"margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, =
204); padding-left: 1ex;"><div dir=3D"ltr"><div>&nbsp;</div></div></blockqu=
ote><blockquote class=3D"gmail_quote" style=3D"margin: 0pt 0pt 0pt 0.8ex; b=
order-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div dir=3D"l=
tr"><div><br></div><div>Should octal input be supported if base =3D 0?</div=
></div></blockquote><div><br>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).<br></div></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_529_2003756268.1434124160583--
------=_Part_528_1549752212.1434124160583--

.
