220 29438 <f8c8b5e6-3d69-4605-bd5d-161c3e47ca7e@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Louis Dionne <ldionne.2@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Allowing string literals to match `char...` packs
 in templates
Date: Thu, 17 Nov 2016 00:23:19 -0800 (PST)
Lines: 113
Approved: news@gmane.org
Message-ID: <f8c8b5e6-3d69-4605-bd5d-161c3e47ca7e@isocpp.org>
References: <9de07b5f-f870-4a02-882f-54f9fdd12ffd@isocpp.org>
 <CANh8DEm_8ngPVZyMAP4GU8nbvgiD2XxBrLT0M1Pk94m8+tQrug@mail.gmail.com>
 <d9433fac-152f-4515-b518-985a78768c03@isocpp.org> <6b73bf50-4189-4d5d-a2c0-2debb085659e@isocpp.org>
 <f99786d0-d4fd-40ee-89fe-89399fe8d600@isocpp.org> <10914b55-c188-4573-a4c7-ba686f213a38@isocpp.org>
 <CAEddoJZf-Y9D90ZePLoMv_HcFeCJz+FC25WRVdWZjbsrrS4FEQ@mail.gmail.com>
 <CAFk2RUY2PhGLKB89dun0teFynYW104xr4w-+kV-ae2tJX5W8YA@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_4940_1827998296.1479370999176"
X-Trace: blaine.gmane.org 1479371003 10252 195.159.176.226 (17 Nov 2016 08:23:23 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Thu, 17 Nov 2016 08:23:23 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCV3HSWWRMMRB56RWXAQKGQE7F6KI4A@isocpp.org Thu Nov 17 09:23:18 2016
Return-path: <std-proposals+bncBCV3HSWWRMMRB56RWXAQKGQE7F6KI4A@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-vk0-f70.google.com ([209.85.213.70])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCV3HSWWRMMRB56RWXAQKGQE7F6KI4A@isocpp.org>)
	id 1c7HyX-0001X2-Hm
	for gclcip-std-proposals@m.gmane.org; Thu, 17 Nov 2016 09:23:17 +0100
Original-Received: by mail-vk0-f70.google.com with SMTP id 19sf132411939vko.0
        for <gclcip-std-proposals@m.gmane.org>; Thu, 17 Nov 2016 00:23:21 -0800 (PST)
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=LcFNCoOn5gcJ/dDXihlQrNcuAq2iIbd/+o1k29uSqOI=;
        b=wUHA793ZAyr2ZdekijL1LU3UTAIXRk+DIVi4SXwDAbAn78rPxCUU4VBncXIJcN1nox
         vDQcx7UDHg1ITtJQ3nQVatnZQ0kfuIj5AhTPM3MN3Vh88Rlz/A6YZzQ+OwLGJkOs83UR
         F3bfV5gOIe7qRfqX+TsN5/iyQQOvRCfavJurBKc2ShXAe/LSB4qxkYHoH2BOOLhZHKC6
         KsgbkdxRkPex1oQuGd+UJY6xGbsuXI/hHicoCvlm13NJmZnj6erZ1/5QZc2knHG0T50I
         JFEHi+Y6MiStZYPzJTFRuQYkiJpP7PdoWa6+D9WORS9aUBwFUIByaem4m93MaZ2uYFZ9
         4YZQ==
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=LcFNCoOn5gcJ/dDXihlQrNcuAq2iIbd/+o1k29uSqOI=;
        b=VuqV7iJY5GBBnqwIgzix1j68Habqf9N1iOB7LFKQvt/i/hnTetQyOdSq7JDIILPjc8
         uA6wQ2sn7rU5fF3Oh7MaW6EglIBjPhBWE5Q7+bqRbhr2hHzwuBv3jVyjp854pqimTQrZ
         UTedqLzhbYto9k0QnIoF+MZ2hLYZdfWAq3gwk/xue6LAEo/DCFCodNfi4WcRV0rN5iXW
         1Eo6NV51tBXAqRJhDqdX1ZK0rBiES75KH+A8KPhdL9Zf/FaCphYrwxGd7VjUZD+WpsyT
         0qBxcHSx7fmopvFrm0N/PKztoXqSIQ1p7/TXXTKHAxpZG0ON/AX/mh5LMr6GoqZhT/AC
         Zk7w==
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=LcFNCoOn5gcJ/dDXihlQrNcuAq2iIbd/+o1k29uSqOI=;
        b=FQInNEl3NF4UeSYa9IZrGJRO1MStL7nzpEsBmlqJfoluF9ndJRxN1cOg++USIdAv3U
         hnJkAJDYt+x/ylh0JIiNIb8YCzjh1O6TiuqN6IftnE0xcc5H2ntpSJXRuYT5wwPArWhI
         VxRxdKg0dq+cscwoSTjPFnyufffxiQQhzzn8uE8+iCrSr8YK0VWENV0/wsDxGw4EaTx/
         eNUoV5+5x1QhW8lzEz8nEwQrN2L0eVY1sH4Dcy/PJ+jE+3mthZS6XTf/8qvuLSvPjwTd
         O/RJ+RM6gz5dopc+WS+lnUZiJqpRN/t8FAR40bUxklJtr4MGDty9rXR0AwOPlpPhe9aY
         yoAA==
X-Gm-Message-State: AKaTC02xG0H+7neCblJ9RyJBQUwBtQzGOlOTieciIJ65h2Qnmyd6O7DSyzgaysIgiCnyCw==
X-Received: by 10.159.35.118 with SMTP id 109mr381520uae.13.1479371000406;
        Thu, 17 Nov 2016 00:23:20 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.157.56.209 with SMTP id k17ls3639612ote.14.gmail; Thu, 17 Nov
 2016 00:23:19 -0800 (PST)
X-Received: by 10.157.37.125 with SMTP id j58mr114524otd.18.1479370999620;
        Thu, 17 Nov 2016 00:23:19 -0800 (PST)
In-Reply-To: <CAFk2RUY2PhGLKB89dun0teFynYW104xr4w-+kV-ae2tJX5W8YA@mail.gmail.com>
X-Original-Sender: ldionne.2@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:29438
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/29438>

------=_Part_4940_1827998296.1479370999176
Content-Type: multipart/alternative; 
	boundary="----=_Part_4941_694291348.1479370999177"

------=_Part_4941_694291348.1479370999177
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Another problem is that "different" literals for address purposes could be=
=20
the
same when doing a strcmp-style comparison. Consider:

    foo<"hello world">
    foo<"hello world\0abcd">

Should these two resolve to the same template? If we use the address of=20
literals,
certainly not. If we compare the contents of the string, I guess that=20
remains an
open issue but the two behaviors could be envisioned.

Louis


On Thursday, 17 November 2016 09:19:32 UTC+1, Ville Voutilainen wrote:
>
> On 17 November 2016 at 10:13, Jonathan M=C3=BCller=20
> <jonathanm...@gmail.com <javascript:>> wrote:=20
> > Sorry if I'm asking the obvious question here: Why not guarantee that=
=20
> > different string literals have different addresses and the same string=
=20
> > literal has the same address and use const char* as non-type template=
=20
> > parameters?=20
>
> It's less of a problem of guaranteeing that different literals have=20
> different addresses, and=20
> more a problem of avoiding identical literals possibly having=20
> different addresses. Therefore=20
> it's better to have the template equivalence be determined by the=20
> contents of the string=20
> rather than the address.=20
>

--=20
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 e=
mail 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/f8c8b5e6-3d69-4605-bd5d-161c3e47ca7e%40isocpp.or=
g.

------=_Part_4941_694291348.1479370999177
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div><div>Another problem is that &quot;different&quot; li=
terals for address purposes could be the</div><div>same when doing a strcmp=
-style comparison. Consider:</div><div><br></div><div>=C2=A0 =C2=A0 foo&lt;=
&quot;hello world&quot;&gt;</div><div>=C2=A0 =C2=A0 foo&lt;&quot;hello worl=
d\0abcd&quot;&gt;</div><div><br></div><div>Should these two resolve to the =
same template? If we use the address of literals,</div><div>certainly not. =
If we compare the contents of the string, I guess that remains an</div><div=
>open issue but the two behaviors could be envisioned.</div><div><br></div>=
<div>Louis</div></div><br><br>On Thursday, 17 November 2016 09:19:32 UTC+1,=
 Ville Voutilainen  wrote:<blockquote class=3D"gmail_quote" style=3D"margin=
: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">On 1=
7 November 2016 at 10:13, Jonathan M=C3=BCller
<br>&lt;<a href=3D"javascript:" target=3D"_blank" gdf-obfuscated-mailto=3D"=
eG2iRnltAQAJ" rel=3D"nofollow" onmousedown=3D"this.href=3D&#39;javascript:&=
#39;;return true;" onclick=3D"this.href=3D&#39;javascript:&#39;;return true=
;">jonathanm...@gmail.com</a><wbr>&gt; wrote:
<br>&gt; Sorry if I&#39;m asking the obvious question here: Why not guarant=
ee that
<br>&gt; different string literals have different addresses and the same st=
ring
<br>&gt; literal has the same address and use const char* as non-type templ=
ate
<br>&gt; parameters?
<br>
<br>It&#39;s less of a problem of guaranteeing that different literals have
<br>different addresses, and
<br>more a problem of avoiding identical literals possibly having
<br>different addresses. Therefore
<br>it&#39;s better to have the template equivalence be determined by the
<br>contents of the string
<br>rather than the address.
<br></blockquote></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/f8c8b5e6-3d69-4605-bd5d-161c3e47ca7e%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/f8c8b5e6-3d69-4605-bd5d-161c3e47ca7e=
%40isocpp.org</a>.<br />

------=_Part_4941_694291348.1479370999177--

------=_Part_4940_1827998296.1479370999176--

.
