220 29109 <0f446da6-6374-487e-b41e-5435f0dfa2c6@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: "T. C." <rs2740@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Removing trivial undefined behaviour
Date: Wed, 26 Oct 2016 08:55:31 -0700 (PDT)
Lines: 155
Approved: news@gmane.org
Message-ID: <0f446da6-6374-487e-b41e-5435f0dfa2c6@isocpp.org>
References: <35daf87a-bf1d-46de-b16c-c2965fbadc8f@isocpp.org>
 <9e242562-aba1-4f8d-8e0a-b2de34f6a10b@isocpp.org> <d24d9d41-d5ba-47ed-8e98-915f84063a92@isocpp.org>
 <c976d139-ae31-4756-96a6-30a69d81f14d@isocpp.org> <CAOHCbiu0Hd7LsMkKGcvxvo7h3TJzjZAuXPWxNT0WuESUfrFCaw@mail.gmail.com>
 <1314a997-2f74-4b52-9755-bc9d1deb6982@isocpp.org>
 <CANh8DEmWMr0u==FPgaw4mnpv1UHCMnPfvonhJpwjTxuxw+La=g@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_1889_685078059.1477497331824"
X-Trace: blaine.gmane.org 1477497345 22490 195.159.176.226 (26 Oct 2016 15:55:45 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Wed, 26 Oct 2016 15:55:45 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCQ43G7NQIIRB5NDYPAAKGQES6TZ3SA@isocpp.org Wed Oct 26 17:55:41 2016
Return-path: <std-proposals+bncBCQ43G7NQIIRB5NDYPAAKGQES6TZ3SA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-yw0-f199.google.com ([209.85.161.199])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCQ43G7NQIIRB5NDYPAAKGQES6TZ3SA@isocpp.org>)
	id 1bzQY8-0004Pm-Oe
	for gclcip-std-proposals@m.gmane.org; Wed, 26 Oct 2016 17:55:32 +0200
Original-Received: by mail-yw0-f199.google.com with SMTP id w3sf12649609ywg.1
        for <gclcip-std-proposals@m.gmane.org>; Wed, 26 Oct 2016 08:55:35 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :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=J0Z4zteJDAdrcWKeUnxPaykQ4tHnK9t4QKPbBw7BMJ8=;
        b=Q5YKipbI4wS4UeeMb0iHwY6PNBbFJSL0hwLGKsRYMP1Ve48oMhX9fmvEOoa5GTEHHZ
         sWIXwKlhkWuUuYxdYNF7Zrbl6zzk4LtV0dpv9oSLZALM7Tj3a1a+rhvomlcmM6y6rUbt
         lVOV4CKpRyMfJER9kfs7gMx66fiXSD43b6uXWgnxLJWZOKxQ+8ePnFpor64fnNxUpk5b
         I8Otbl6hA/pqgdTpIm9Pms+T4UORHAWey/WuV7AwzQKLa0Po+jx0ViwRDk5MEaCia2NG
         VZ1wnHh4wZVI5FW4UXKcAkttkOPOZ6epJrVrYTqSqE9N05Wp686gZ4mzasidmYbTzZOU
         /pTA==
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
         :x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=J0Z4zteJDAdrcWKeUnxPaykQ4tHnK9t4QKPbBw7BMJ8=;
        b=KwsFCvL4da7DKYVlBFKWGCAbbHFAnJNrxnILasp5eljX52kxbxxCQkG0xWt5ZXVSE9
         bHeQ4mx3bpzCHh7WjNnBfEv1nKaThzu2qXQUL6obA/ZsVwqysq/1Lp457sKbi3LImJLR
         9FAVt9KJIQdh30bfapoQDdlnKofDv7/DTZwr3/KnLkc8GezF+59IC0sbYvztoxsO+Qoh
         Mcb7Ze7Q6sLEueuwnuTUNNAM34DcS1jsf3BHb7bpjSFr2xeRfq5gc7T86sFj3wHMTJjH
         oL3TYPnUM7pqYw/L1hcy9bBwNcKw+vhV0qRlsAY5zAofs8Cxb6++vXpJYVTCsuLr720a
         rk4A==
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:x-spam-checked-in-group:list-post:list-help
         :list-archive:list-subscribe:list-unsubscribe;
        bh=J0Z4zteJDAdrcWKeUnxPaykQ4tHnK9t4QKPbBw7BMJ8=;
        b=IXUL0cPPxDY1+ajKUP8jKcpcgHAk+pae6Bixh0uY5e0O/2vUPzjkcpvs+lZBKbc7IG
         MczHqKd6MZLEICUq66ZECDIOtm2N2T1dii7npWqKoaGL90pxUmO0641UO94GxRaeG12F
         WkaTddq7+2jjgKNLd/QSSK1GdMoSvdHdIJY8+LOMwYHUDURm7DAZm2+mYurftXDkViZT
         Y/3tOPsRX4G2Yn+JAo/O8r+soIjYjY7mYZFenI8+VRs8XqqHRvipExok6vGQIYi/If5Y
         KqluiLkGR/8Fz01VgBhvGX2KXnoF8izwjzQvqEzmAyYAIXA6Nt8PPDE3k3Ie2XxOKYKi
         gFPw==
X-Gm-Message-State: ABUngve3ecp/5meO1bTg01W+GoawOdkytKFvchY6eSx6bAfXfm6AHnmQGf8n0d6Nb1VGgw==
X-Received: by 10.13.210.7 with SMTP id u7mr960019ywd.148.1477497335194;
        Wed, 26 Oct 2016 08:55:35 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.36.237.201 with SMTP id r192ls2145942ith.0.canary-gmail; Wed,
 26 Oct 2016 08:55:33 -0700 (PDT)
X-Received: by 10.36.103.2 with SMTP id u2mr611628itc.6.1477497333111;
        Wed, 26 Oct 2016 08:55:33 -0700 (PDT)
In-Reply-To: <CANh8DEmWMr0u==FPgaw4mnpv1UHCMnPfvonhJpwjTxuxw+La=g@mail.gmail.com>
X-Original-Sender: rs2740@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: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://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>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:29109
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/29109>

------=_Part_1889_685078059.1477497331824
Content-Type: multipart/alternative; 
	boundary="----=_Part_1890_1139757925.1477497331824"

------=_Part_1890_1139757925.1477497331824
Content-Type: text/plain; charset=UTF-8



On Wednesday, October 26, 2016 at 11:45:09 AM UTC-4, Matt Calabrese wrote:
>
>
>
> On Wed, Oct 26, 2016 at 11:34 AM, T. C. <rs2...@gmail.com <javascript:>> 
> wrote:
>
>>
>>
>> On Wednesday, October 26, 2016 at 9:19:15 AM UTC-4, Tony V E wrote:
>>>
>>>
>>>
>>> On Wed, Oct 26, 2016 at 4:28 AM, T. C. <rs2...@gmail.com> wrote:
>>>
>>>>
>>>>
>>>> On Wednesday, October 26, 2016 at 3:20:55 AM UTC-4, Hans Guijt wrote:
>>>>>
>>>>>
>>>>> On Wednesday, October 26, 2016 at 9:11:26 AM UTC+2, T. C. wrote:
>>>>>>
>>>>>>
>>>>>> Because they are meant to be used as isdigit((unsigned char) c).
>>>>>>
>>>>>  
>>>>> Great, in that case I'm sure there is no opposition to changing the 
>>>>> signature to reflect this requirement? It's a much cleaner solution than 
>>>>> requiring a cast in every invocation, after all.
>>>>>
>>>>>
>>>>>
>>>> The reason they take int is because they also accept EOF. That's C's 
>>>> style, for better or worse.
>>>>
>>>> In any event, there's no way in hell C++ is going to change this. It's 
>>>> a massive C compatibility break.
>>>>
>>>
>>> We could maybe overload the function:
>>>
>>> int isdigit(int c);
>>> bool isdigit(char c);
>>>
>>> No idea if that is a good idea.
>>>
>>>>
>>>> -- 
>>> Be seeing you,
>>> Tony
>>>
>>
>> That breaks anything that expects ::isdigit to be unambiguous (e.g., pass 
>> it to an algorithm). 
>>
>
> I thought the standard doesn't sanction such uses of standard library 
> facilities, unless I'm mistaken. 
>

I don't recall anything that says you can't do it. (You can't take the 
address of *member* functions, but nonmembers is another matter.)

In any event, it can also make existing calls ambiguous (with an argument 
that converts equally well to int and char), so there's a need to check how 
much this will break.

-- 
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/0f446da6-6374-487e-b41e-5435f0dfa2c6%40isocpp.org.

------=_Part_1890_1139757925.1477497331824
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>On Wednesday, October 26, 2016 at 11:45:09 AM UTC-=
4, Matt Calabrese wrote:<blockquote class=3D"gmail_quote" style=3D"margin: =
0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div d=
ir=3D"ltr"><br><div><br><div class=3D"gmail_quote">On Wed, Oct 26, 2016 at =
11:34 AM, T. C. <span dir=3D"ltr">&lt;<a href=3D"javascript:" target=3D"_bl=
ank" gdf-obfuscated-mailto=3D"W1u9WzJ8AQAJ" rel=3D"nofollow" onmousedown=3D=
"this.href=3D&#39;javascript:&#39;;return true;" onclick=3D"this.href=3D&#3=
9;javascript:&#39;;return true;">rs2...@gmail.com</a>&gt;</span> wrote:<br>=
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div dir=3D"ltr"><br><br>On Wednesday, Octob=
er 26, 2016 at 9:19:15 AM UTC-4, Tony V E wrote:<span><blockquote class=3D"=
gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid=
;padding-left:1ex"><div dir=3D"ltr"><br><div><br><div class=3D"gmail_quote"=
>On Wed, Oct 26, 2016 at 4:28 AM, T. C. <span dir=3D"ltr">&lt;<a rel=3D"nof=
ollow">rs2...@gmail.com</a>&gt;</span> wrote:<br><blockquote class=3D"gmail=
_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:=
1ex"><div dir=3D"ltr"><span><br><br>On Wednesday, October 26, 2016 at 3:20:=
55 AM UTC-4, Hans Guijt wrote:<blockquote class=3D"gmail_quote" style=3D"ma=
rgin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div =
dir=3D"ltr"><br>On Wednesday, October 26, 2016 at 9:11:26 AM UTC+2, T. C. w=
rote:<blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;=
border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div><br></di=
v><div>Because they are meant to be used as isdigit((unsigned char) c).</di=
v></div></blockquote><div>=C2=A0</div><div>Great, in that case I&#39;m sure=
 there is no opposition to changing the signature to reflect this requireme=
nt? It&#39;s a much cleaner solution than requiring a cast in every invocat=
ion, after all.<br><br><br></div></div></blockquote><div><br></div></span><=
div>The reason they take int is because they also accept EOF. That&#39;s C&=
#39;s style, for better or worse.</div><div><br></div><div>In any event, th=
ere&#39;s no way in hell C++ is going to change this. It&#39;s a massive C =
compatibility break.</div></div></blockquote><div><br></div><div>We could m=
aybe overload the function:<br><br></div><div>int isdigit(int c);<br></div>=
<div>bool isdigit(char c);<br><br></div><div>No idea if that is a good idea=
..<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;bor=
der-left:1px #ccc solid;padding-left:1ex"><span>

<p></p></span><br></blockquote></div>-- <br><div><div dir=3D"ltr"><div>Be s=
eeing you,<br></div>Tony<br></div></div></div></div></blockquote><div><br><=
/div></span><div>That breaks anything that expects ::isdigit=C2=A0to be una=
mbiguous (e.g., pass it to an algorithm).=C2=A0</div></div></blockquote><di=
v><br></div><div>I thought the standard doesn&#39;t sanction such uses of s=
tandard library facilities, unless I&#39;m mistaken.=C2=A0</div></div></div=
></div></blockquote><div><br></div><div>I don&#39;t recall anything that sa=
ys you can&#39;t do it. (You can&#39;t take the address of *member* functio=
ns, but nonmembers is another matter.)</div><div><br></div><div>In any even=
t, it can also make existing calls ambiguous (with an argument that convert=
s equally well to int and char), so there&#39;s a need to check how much th=
is will break.</div></div>

<p></p>

-- <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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/0f446da6-6374-487e-b41e-5435f0dfa2c6%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/0f446da6-6374-487e-b41e-5435f0dfa2c6=
%40isocpp.org</a>.<br />

------=_Part_1890_1139757925.1477497331824--

------=_Part_1889_685078059.1477497331824--

.
