220 29482 <a0d1a03d-d330-eb1b-13b1-0d241107c8b4@honermann.net> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Tom Honermann <tom@honermann.net>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Allowing string literals to match `char...` packs
 in templates
Date: Fri, 18 Nov 2016 16:42:12 -0500
Lines: 137
Approved: news@gmane.org
Message-ID: <a0d1a03d-d330-eb1b-13b1-0d241107c8b4@honermann.net>
References: <9de07b5f-f870-4a02-882f-54f9fdd12ffd@isocpp.org>
 <CANh8DEm_8ngPVZyMAP4GU8nbvgiD2XxBrLT0M1Pk94m8+tQrug@mail.gmail.com>
 <d9433fac-152f-4515-b518-985a78768c03@isocpp.org>
 <35fe3945-71cf-4958-8f92-59df0ef98fae@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative;
 boundary="------------8E17D3790B21A96AB15C4D24"
X-Trace: blaine.gmane.org 1479505338 12946 195.159.176.226 (18 Nov 2016 21:42:18 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Fri, 18 Nov 2016 21:42:18 +0000 (UTC)
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101
 Thunderbird/45.4.0
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDBNXSHG6UDBBOHLXXAQKGQECQ327TQ@isocpp.org Fri Nov 18 22:42:14 2016
Return-path: <std-proposals+bncBDBNXSHG6UDBBOHLXXAQKGQECQ327TQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-oi0-f71.google.com ([209.85.218.71])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBDBNXSHG6UDBBOHLXXAQKGQECQ327TQ@isocpp.org>)
	id 1c7qvF-0002xO-LS
	for gclcip-std-proposals@m.gmane.org; Fri, 18 Nov 2016 22:42:13 +0100
Original-Received: by mail-oi0-f71.google.com with SMTP id j198sf254331284oih.5
        for <gclcip-std-proposals@m.gmane.org>; Fri, 18 Nov 2016 13:42:17 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=subject:to:references:from:message-id:date:user-agent:mime-version
         :in-reply-to: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=5trYI+OcEvVaZSqg3sWd91vwPbKhVQTcbtU1zXDHmZo=;
        b=gdY1Jl/pF6MOIjcdpSDSFe3PrGDQ6e7Vy2ybhJko/fHr01KS6R96zTX2LZzJ3JpJpZ
         lWX2Xx3S0q3NwE6zEdU5K+56FZLsC/5D49OP01r7mTVOrhyCQri807SDy0y41GQ26Jnm
         tPL+QFyBuDEgTdovoWvT2ek/Cf7gAjkh6bT1v7m/Nx0yzgOANUr+/W/gH+StMJOxde8t
         kbjOH1NZObDI73/B2Bjmc0YJszr+wMZgqKT8GLF6jE6EC05WsGVbDiU2GXsPkZCFC1DB
         U4EVfW4z9/pfamuSp83ba2SZ73QF9utMWcLbBMXjagUlzsES5DiHXBj/MVyD4U7rfSac
         fhqA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:subject:to:references:from:message-id:date
         :user-agent:mime-version:in-reply-to: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=5trYI+OcEvVaZSqg3sWd91vwPbKhVQTcbtU1zXDHmZo=;
        b=TiB4ix190Bx30hNigTelhMAmraUZF+We6ZT1xrfO+CycAnJ+v5n4KHrfnVBeeylb7i
         Xe9QXAecBLw8DBQ6eYYhDayOgKf8brJWvlzIWek/HlwQePdNWb0hwR+ueOabU8Sax0VJ
         BRegxPN/9X5NYn89ZbHqTVA8W3NWSbUAnIO06xkREWw9xJbK8rDaXoyUZ0mnHcSl7hSc
         w2uR3w1vKmON728I6vMxWSIvSzhmznyAqqP+5ue/81RoIpnH3Gt1vaJs8/5yWgrMQ5Si
         ysYsu54w0aey5I+IX5hLd3panCk/17RLy8CrNHf0GXUuWdJ0O1HWZLSb7dC6LD7ec4Sk
         PHmw==
X-Gm-Message-State: AKaTC00aMbTwwJ9ZSrUaVdwIztKtMWLScqV1QK/hUw5Xm/70yifmxav44wjLZZKD4WeQLw==
X-Received: by 10.157.11.193 with SMTP id 59mr625791oth.118.1479505336950;
        Fri, 18 Nov 2016 13:42:16 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.157.18.246 with SMTP id g109ls8672894otg.7.gmail; Fri, 18 Nov
 2016 13:42:16 -0800 (PST)
X-Received: by 10.233.237.147 with SMTP id c141mr2234055qkg.175.1479505336037;
        Fri, 18 Nov 2016 13:42:16 -0800 (PST)
Original-Received: from smtp83.iad3a.emailsrvr.com (smtp83.iad3a.emailsrvr.com. [173.203.187.83])
        by mx.google.com with ESMTPS id h24si2930382qtf.266.2016.11.18.13.42.15
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Fri, 18 Nov 2016 13:42:15 -0800 (PST)
Received-SPF: neutral (google.com: 173.203.187.83 is neither permitted nor denied by best guess record for domain of tom@honermann.net) client-ip=173.203.187.83;
Original-Received: from smtp27.relay.iad3a.emailsrvr.com (localhost [127.0.0.1])
	by smtp27.relay.iad3a.emailsrvr.com (SMTP Server) with ESMTP id BE0F124CE5
	for <std-proposals@isocpp.org>; Fri, 18 Nov 2016 16:42:15 -0500 (EST)
X-Auth-ID: tom@honermann.net
Original-Received: by smtp27.relay.iad3a.emailsrvr.com (Authenticated sender: tom-AT-honermann.net) with ESMTPSA id A6CE624B7F
	for <std-proposals@isocpp.org>; Fri, 18 Nov 2016 16:42:15 -0500 (EST)
X-Sender-Id: tom@honermann.net
Original-Received: from [10.12.196.91] (pool-71-176-249-9.rcmdva.fios.verizon.net [71.176.249.9])
	(using TLSv1.2 with cipher DHE-RSA-AES128-SHA)
	by 0.0.0.0:587 (trex/5.7.12);
	Fri, 18 Nov 2016 16:42:15 -0500
In-Reply-To: <35fe3945-71cf-4958-8f92-59df0ef98fae@isocpp.org>
X-Original-Sender: tom@honermann.net
X-Original-Authentication-Results: mx.google.com;       spf=neutral
 (google.com: 173.203.187.83 is neither permitted nor denied by best guess
 record for domain of tom@honermann.net) smtp.mailfrom=tom@honermann.net
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:29482
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/29482>

This is a multi-part message in MIME format.
--------------8E17D3790B21A96AB15C4D24
Content-Type: text/plain; charset=UTF-8; format=flowed

On 11/18/2016 3:47 PM, inkwizytoryankes@gmail.com wrote:
>
>
> On Thursday, November 17, 2016 at 6:28:26 AM UTC+1, Louis Dionne wrote:
>
>     Let me just expand a bit on what Matt said.
>
>     I think this is a brilliant idea, but I don't think it's going to
>     work, for the same reason
>     as my P0424R0 paper was not warmly received. The reason is that
>     implementers
>     don't want anything that encourages the use of large template
>     parameter lists,
>     because the representation of that inside the compiler is too
>     inefficient. They don't
>     want a single template parameter per character in the string,
>     because the structure
>     that represents a template parameter in the compiler is expensive.
>     Instead, they'd
>     rather have a single structure that represents all the characters.
>     I'm not sure why they
>     can't just represent a character pack in a more efficient manner,
>     but that's what I
>     was told when I presented in EWG.
>
>
> Fact that storing string in template parameters list is ineffective 
> did not stop GCC and Clang from implementing this:
> https://godbolt.org/g/VjJzJi
> https://godbolt.org/g/1DVftM
> Thanks to that we can test how far we need push compilers to break 
> when we use this UDL.

I'd still prefer to be able to do something like this:

template<std::size_t N>
constexpr X operator""_udl(const char (&sl)[N]) { ... }

Tom.

-- 
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/a0d1a03d-d330-eb1b-13b1-0d241107c8b4%40honermann.net.

--------------8E17D3790B21A96AB15C4D24
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<html>
  <head>
    <meta content=3D"text/html; charset=3Dutf-8" http-equiv=3D"Content-Type=
">
  </head>
  <body bgcolor=3D"#FFFFFF" text=3D"#000000">
    <div class=3D"moz-cite-prefix">On 11/18/2016 3:47 PM,
      <a class=3D"moz-txt-link-abbreviated" href=3D"mailto:inkwizytoryankes=
@gmail.com">inkwizytoryankes@gmail.com</a> wrote:<br>
    </div>
    <blockquote
      cite=3D"mid:35fe3945-71cf-4958-8f92-59df0ef98fae@isocpp.org"
      type=3D"cite">
      <div dir=3D"ltr"><br>
        <br>
        On Thursday, November 17, 2016 at 6:28:26 AM UTC+1, Louis Dionne
        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"ltr">
            <div>Let me just expand a bit on what Matt said.</div>
            <div><br>
            </div>
            <div>I think this is a brilliant idea, but I don't think
              it's going to work, for the same reason</div>
            <div>as my P0424R0 paper was not warmly received. The reason
              is that implementers</div>
            <div>don't want anything that encourages the use of large
              template parameter lists,</div>
            <div>because the representation of that inside the compiler
              is too inefficient. They don't</div>
            <div>want a single template parameter per character in the
              string, because the structure</div>
            <div>that represents a template parameter in the compiler is
              expensive. Instead, they'd</div>
            <div>rather have a single structure that represents all the
              characters. I'm not sure why they</div>
            <div>can't just represent a character pack in a more
              efficient manner, but that's what I</div>
            <div>was told when I presented in EWG.</div>
            <br>
          </div>
        </blockquote>
        <div><br>
          Fact that storing string in template parameters list is
          ineffective did not stop GCC and Clang from implementing this:<br=
>
          <a class=3D"moz-txt-link-freetext" href=3D"https://godbolt.org/g/=
VjJzJi">https://godbolt.org/g/VjJzJi</a><br>
          <a class=3D"moz-txt-link-freetext" href=3D"https://godbolt.org/g/=
1DVftM">https://godbolt.org/g/1DVftM</a><br>
          Thanks to that we can test how far we need push compilers to
          break when we use this UDL.</div>
      </div>
    </blockquote>
    <br>
    I'd still prefer to be able to do something like this:<br>
    <br>
    template&lt;std::size_t N&gt;<br>
    constexpr X operator""_udl(const char (&amp;sl)[N]) { ... }<br>
    <br>
    Tom.<br>
  </body>
</html>

<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/a0d1a03d-d330-eb1b-13b1-0d241107c8b4%=
40honermann.net?utm_medium=3Demail&utm_source=3Dfooter">https://groups.goog=
le.com/a/isocpp.org/d/msgid/std-proposals/a0d1a03d-d330-eb1b-13b1-0d241107c=
8b4%40honermann.net</a>.<br />

--------------8E17D3790B21A96AB15C4D24--

.
