220 13407 <d3e90774-dbe8-4ae8-9e68-3fd5906b9ae6@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: Re: constexpr ascii character checks
Date: Tue, 30 Sep 2014 17:34:44 -0700 (PDT)
Lines: 129
Approved: news@gmane.org
Message-ID: <d3e90774-dbe8-4ae8-9e68-3fd5906b9ae6@isocpp.org>
References: <c9a50690-0464-43e5-8da7-e9a42e9c548a@isocpp.org> <3848703.davq006XdY@tjmaciei-mobl4> <ac6e3ffa-5a32-4c02-be5c-9c666c1b016a@isocpp.org>
 <2650743.qSLh741pjc@tjmaciei-mobl4>
 <80b406dd-3327-4f39-a885-75ad6e692fef@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; 
	boundary="----=_Part_5087_1792116971.1412123685062"
X-Trace: ger.gmane.org 1412123694 6920 80.91.229.3 (1 Oct 2014 00:34:54 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Wed, 1 Oct 2014 00:34:54 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDELF54RTIGRBJUYVWQQKGQEGBEXNDA@isocpp.org Wed Oct 01 02:34:49 2014
Return-path: <std-proposals+bncBDELF54RTIGRBJUYVWQQKGQEGBEXNDA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ie0-f197.google.com ([209.85.223.197])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDELF54RTIGRBJUYVWQQKGQEGBEXNDA@isocpp.org>)
	id 1XZ7sV-0007AY-JY
	for gclcip-std-proposals@m.gmane.org; Wed, 01 Oct 2014 02:34:47 +0200
Original-Received: by mail-ie0-f197.google.com with SMTP id rp18sf329590iec.8
        for <gclcip-std-proposals@m.gmane.org>; Tue, 30 Sep 2014 17:34:46 -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
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe
         :content-type;
        bh=uhAhz0AxBpgP1gxoKeI2p1+5frJZLPKMpwuBx7TEPkg=;
        b=PJpHOk8T58MvP5/T0imv20v823u0CWStdyI2J7BiXZ/oj0ki21zn4zPyOEaZ897g8o
         Q1AyzGVdSuwq9UV4iGraB6xvX0fpRSYXzP+6qHU8/DeSU9IO7lN2zZogrWr5AXoMBGVm
         kxRtiAyMK0jg0nnF1EpZlWeqeuUu/ZvX10UMids2OIIBYpQmR/k6QmeOacNUaW4y3X3T
         jtCNXZqGA8O5b6uUNtighaEo9ZAkoeJNMhGqecJPTX4D3DPM6fIroAytg4eseY6sPmXv
         JewW6NZotH/HY12aVEySeUPPmYmyLaKhQiPShpUMG/GcN2tBjtfoRAcYFx/+3MN7ozP7
         rTTA==
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:x-original-sender:reply-to:precedence
         :mailing-list:list-id:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe:content-type;
        bh=uhAhz0AxBpgP1gxoKeI2p1+5frJZLPKMpwuBx7TEPkg=;
        b=glasb02mz1WAP4AfjaN47uaxbAYuzF6dJOM3tvAzhV20qFtBZSVAyE2dZVHFoCR+DL
         U1kBdnpyNdsCp3XCH99/MUgfZMQFbNKedV5jd4sBecgcQZC5nYWisyq5fhXC4V+M6oji
         RZEx4VXsel2dwp2LRlRrHgwFi9ar5kGxRzjWjF+DGNwstpCPeTY2ddZCQdtfCFzY6fN/
         aQiM/bGLkR9ZWhcvC0Fw20qxOm7VM5m44wgfaCHsCtCx6g2heF8xNiVHfJtNgUjkc45x
         HMwDGfRzRN82yOUK/lXwMMnEBmyfmtK3e0mhC0s0hlSByuPFycGD//txtsSZPgXCVbzm
         SoNA==
X-Gm-Message-State: ALoCoQlECeVLILJiHPgBYZVz3fazXfSll8wjwYCa4i6yLC/OjkYkAzUEFPJLLKcc9gPcJdWb6Hu8
X-Received: by 10.182.66.234 with SMTP id i10mr42956697obt.12.1412123686716;
        Tue, 30 Sep 2014 17:34:46 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.140.108.229 with SMTP id j92ls299998qgf.31.gmail; Tue, 30 Sep
 2014 17:34:46 -0700 (PDT)
X-Received: by 10.140.37.39 with SMTP id q36mr33036qgq.10.1412123686067;
        Tue, 30 Sep 2014 17:34:46 -0700 (PDT)
In-Reply-To: <80b406dd-3327-4f39-a885-75ad6e692fef@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-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:13407
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/13407>

------=_Part_5087_1792116971.1412123685062
Content-Type: text/plain; charset=UTF-8



On Tuesday, September 30, 2014 12:25:18 AM UTC-4, Myriachan wrote:
>
> On Saturday, September 27, 2014 6:35:15 PM UTC-7, Thiago Macieira wrote:
>>
>> On Saturday 27 September 2014 00:25:30 Myriachan wrote: 
>> > I meant that "int" can't necessarily hold char16_t and char32_t. 
>>
>> I don't see how "int" got into the discussion. 
>>
>> std::ascii::isxxx should take char, char16_t and char32_t. It stands to 
>> reason 
>> that you already know that a given character is ASCII before using the 
>> function. A wchar_t overload can be present only if the implementation 
>> knows 
>> at compile time that wchar_t is always a superset of ASCII. 
>>
>> The use of int for ctype.h is an extreme legacy from C's obscure past. 
>>
>>
> His draft used "int"; that's why I mentioned it and pointed out why it's 
> problematic.
>
> https://github.com/fmatthew5876/stdcxx-ascii/blob/master/proposal/draft.html
>
>
I originally proposed int so that the functions would be compatible with C 
getchar() and EOF. Looking at it again, perhaps that is not so necessary. I 
never use either of those and even if I did I would be doing an EOF check 
before passing it on to an ascii function. Setting the type to char also 
resolves ambiguities and questions about values that are valid for int but 
invalid for char (such as negative values).

I've changed the proposal to accept char, char16_t, char32_t. A new version 
of the paper is available:

https://github.com/fmatthew5876/stdcxx-ascii

I'm still on the fence about wchar_t. While it looks like the direction is 
for wchar_t to eventually go away there are a lot of people using it. 
Windows developers being the prime example.

Is anyone here a windows developer who would find these functions at all 
useful with wchar_t? Even if wchar_t is planned to be deprecated, we can 
still add overloads now and deprecate them later if and when wchar_t gets 
deprecated.

-- 

--- 
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_5087_1792116971.1412123685062
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>On Tuesday, September 30, 2014 12:25:18 AM UTC-4, =
Myriachan wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin=
-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"lt=
r">On Saturday, September 27, 2014 6:35:15 PM UTC-7, Thiago Macieira wrote:=
<blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;borde=
r-left:1px #ccc solid;padding-left:1ex">On Saturday 27 September 2014 00:25=
:30 Myriachan wrote:
<br>&gt; I meant that "int" can't necessarily hold char16_t and char32_t.
<br>
<br>I don't see how "int" got into the discussion.
<br>
<br>std::ascii::isxxx should take char, char16_t and char32_t. It stands to=
 reason=20
<br>that you already know that a given character is ASCII before using the=
=20
<br>function. A wchar_t overload can be present only if the implementation =
knows=20
<br>at compile time that wchar_t is always a superset of ASCII.
<br>
<br>The use of int for ctype.h is an extreme legacy from C's obscure past.
<br>
<br></blockquote><div><br>His draft used "int"; that's why I mentioned it a=
nd pointed out why it's problematic.<br><a href=3D"https://github.com/fmatt=
hew5876/stdcxx-ascii/blob/master/proposal/draft.html" target=3D"_blank" onm=
ousedown=3D"this.href=3D'https://www.google.com/url?q\75https%3A%2F%2Fgithu=
b.com%2Ffmatthew5876%2Fstdcxx-ascii%2Fblob%2Fmaster%2Fproposal%2Fdraft.html=
\46sa\75D\46sntz\0751\46usg\75AFQjCNFDNdPkvqf4tEJaDiBTgspjVZQKOg';return tr=
ue;" onclick=3D"this.href=3D'https://www.google.com/url?q\75https%3A%2F%2Fg=
ithub.com%2Ffmatthew5876%2Fstdcxx-ascii%2Fblob%2Fmaster%2Fproposal%2Fdraft.=
html\46sa\75D\46sntz\0751\46usg\75AFQjCNFDNdPkvqf4tEJaDiBTgspjVZQKOg';retur=
n true;">https://github.com/<wbr>fmatthew5876/stdcxx-ascii/<wbr>blob/master=
/proposal/draft.<wbr>html</a><br><br></div></div></blockquote><div><br></di=
v><div>I originally proposed int so that the functions would be compatible =
with C getchar() and EOF. Looking at it again, perhaps that is not so neces=
sary. I never use either of those and even if I did I would be doing an EOF=
 check before passing it on to an ascii function. Setting the type to char =
also resolves ambiguities and questions about values that are valid for int=
 but invalid for char (such as negative values).</div><div><br></div><div>I=
've changed the proposal to accept char, char16_t, char32_t. A new version =
of the paper is available:</div><div><br></div><div>https://github.com/fmat=
thew5876/stdcxx-ascii</div><div><br>I'm still on the fence about wchar_t. W=
hile it looks like the direction is for wchar_t to eventually go away there=
 are a lot of people using it. Windows developers being the prime example.<=
/div><div><br></div><div>Is anyone here a windows developer who would find =
these functions at all useful with wchar_t? Even if wchar_t is planned to b=
e deprecated, we can still add overloads now and deprecate them later if an=
d when wchar_t gets deprecated.</div><div><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_5087_1792116971.1412123685062--

.
