220 29483 <12f71e8a-b31f-4c68-be93-d4a513459daf@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:48:42 -0500
Lines: 159
Approved: news@gmane.org
Message-ID: <12f71e8a-b31f-4c68-be93-d4a513459daf@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>
 <a0d1a03d-d330-eb1b-13b1-0d241107c8b4@honermann.net>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative;
 boundary="------------997E246E3BA216A8AEFB6EE7"
X-Trace: blaine.gmane.org 1479505726 23766 195.159.176.226 (18 Nov 2016 21:48:46 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Fri, 18 Nov 2016 21:48:46 +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+bncBDBNXSHG6UDBBO7OXXAQKGQEXJ5URWY@isocpp.org Fri Nov 18 22:48:42 2016
Return-path: <std-proposals+bncBDBNXSHG6UDBBO7OXXAQKGQEXJ5URWY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-pf0-f199.google.com ([209.85.192.199])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBDBNXSHG6UDBBO7OXXAQKGQEXJ5URWY@isocpp.org>)
	id 1c7r1V-00056Y-HF
	for gclcip-std-proposals@m.gmane.org; Fri, 18 Nov 2016 22:48:41 +0100
Original-Received: by mail-pf0-f199.google.com with SMTP id 83sf154372061pfx.1
        for <gclcip-std-proposals@m.gmane.org>; Fri, 18 Nov 2016 13:48:45 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=subject:reply-to:references:to:from:message-id:date:user-agent
         :mime-version:in-reply-to:x-original-sender
         :x-original-authentication-results:precedence:mailing-list:list-id
         :x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=3v4ZLHOQbwD05D4zNJHTd84lMAVqSgBzy54WoIP+QZY=;
        b=LMhVrZVmh0S3K2TCo5rMrr2QPRYRWKPYQhmpZehvyB4CoMgMsMe6cWr7yGJpUrz/or
         110m6qUnbDAkKZ0+hOQISGwnD+nXY9uB1uEbqJvaQuj202Jy+pPM1HyIpjiIOvchBOGV
         Dh8HYw3ZRTADfaYffyaZCFeQoxBW7RlJxQKZUiVIUV1l7GKox8NbBxfzjJ1rEyulHwxz
         TWrYm6F54Z1Ejcya9dRI3QfHKp4xif8QvjG/r8yryNgsDFEmorRKl4BdKl7HM9/D7Jy0
         KHFeEDj2vQLoL1QSV3NMXbOoHKZU8vgVvES6DQtWNntNKbvAZ44+yC2fFmgcK5Wh/bF6
         6PWQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:subject:reply-to:references:to:from:message-id
         :date:user-agent:mime-version:in-reply-to:x-original-sender
         :x-original-authentication-results:precedence:mailing-list:list-id
         :x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=3v4ZLHOQbwD05D4zNJHTd84lMAVqSgBzy54WoIP+QZY=;
        b=UvRugHTWjHyyWvzJkH5feGrIJTluE3WFTE4rkwYHRpwed4tma35VCihfA1vvltWSPi
         gtyr6CAiVQ9IU7s173MvtFGZxF15bELjJIfl/fPvMdE16xwj1vlrQi1V+ipjBITC1oDK
         y65SaKRh30yOLxwXs5VBZkrkuv78MTH+50/frjH2JtW1e34H8iDs+8QeC2XpERnp0o9f
         iI8vXvxGTTUaGq8G63NWTsFKV9EDub2bLbpYvpCl0Z43Dz7G5LL+d+3ACBQv+yMrJvmk
         c2DGUUydprd1Lwc9sHTCHATdkZ1N2UetHA/55UmECst0DQG8zGU2M2nRuMaDydrjctxq
         Sw3w==
X-Gm-Message-State: AKaTC00PWZ6bMGNu/BK6VPXLkHRTSXuNbKyhE+SAofoK0ylpE12KACTWAkEANp2kYK4zUQ==
X-Received: by 10.99.174.65 with SMTP id e1mr673623pgp.18.1479505724710;
        Fri, 18 Nov 2016 13:48:44 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.107.141.141 with SMTP id p135ls725263iod.36.gmail; Fri, 18 Nov
 2016 13:48:43 -0800 (PST)
X-Received: by 10.107.169.95 with SMTP id s92mr1706533ioe.65.1479505723617;
        Fri, 18 Nov 2016 13:48:43 -0800 (PST)
Original-Received: from smtp67.ord1c.emailsrvr.com (smtp67.ord1c.emailsrvr.com. [108.166.43.67])
        by mx.google.com with ESMTPS id e11si7078248ioi.152.2016.11.18.13.48.43
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Fri, 18 Nov 2016 13:48:43 -0800 (PST)
Received-SPF: neutral (google.com: 108.166.43.67 is neither permitted nor denied by best guess record for domain of tom@honermann.net) client-ip=108.166.43.67;
Original-Received: from smtp25.relay.ord1c.emailsrvr.com (localhost [127.0.0.1])
	by smtp25.relay.ord1c.emailsrvr.com (SMTP Server) with ESMTP id 5905720353
	for <std-proposals@isocpp.org>; Fri, 18 Nov 2016 16:48:43 -0500 (EST)
X-Auth-ID: tom@honermann.net
Original-Received: by smtp25.relay.ord1c.emailsrvr.com (Authenticated sender: tom-AT-honermann.net) with ESMTPSA id 1B65F2034C
	for <std-proposals@isocpp.org>; Fri, 18 Nov 2016 16:48:43 -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:48:43 -0500
In-Reply-To: <a0d1a03d-d330-eb1b-13b1-0d241107c8b4@honermann.net>
X-Original-Sender: tom@honermann.net
X-Original-Authentication-Results: mx.google.com;       spf=neutral
 (google.com: 108.166.43.67 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:29483
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/29483>

This is a multi-part message in MIME format.
--------------997E246E3BA216A8AEFB6EE7
Content-Type: text/plain; charset=UTF-8; format=flowed

On 11/18/2016 4:42 PM, Tom Honermann wrote:
> 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]) { ... }

Of course, that doesn't provide the string-literal -> unique type 
mapping (based on string literal contents) that would be desired for at 
least some use cases.

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/12f71e8a-b31f-4c68-be93-d4a513459daf%40honermann.net.

--------------997E246E3BA216A8AEFB6EE7
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 4:42 PM, Tom Honermann
      wrote:<br>
    </div>
    <blockquote
      cite=3D"mid:a0d1a03d-d330-eb1b-13b1-0d241107c8b4@honermann.net"
      type=3D"cite">
      <meta content=3D"text/html; charset=3Dutf-8" http-equiv=3D"Content-Ty=
pe">
      <div class=3D"moz-cite-prefix">On 11/18/2016 3:47 PM, <a
          moz-do-not-send=3D"true" 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 moz-do-not-send=3D"true" class=3D"moz-txt-link-freetext"
              href=3D"https://godbolt.org/g/VjJzJi">https://godbolt.org/g/V=
jJzJi</a><br>
            <a moz-do-not-send=3D"true" class=3D"moz-txt-link-freetext"
              href=3D"https://godbolt.org/g/1DVftM">https://godbolt.org/g/1=
DVftM</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]) { ... }</blockquo=
te>
    <br>
    Of course, that doesn't provide the string-literal -&gt; unique type
    mapping (based on string literal contents) that would be desired for
    at least some use cases.<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/12f71e8a-b31f-4c68-be93-d4a513459daf%=
40honermann.net?utm_medium=3Demail&utm_source=3Dfooter">https://groups.goog=
le.com/a/isocpp.org/d/msgid/std-proposals/12f71e8a-b31f-4c68-be93-d4a513459=
daf%40honermann.net</a>.<br />

--------------997E246E3BA216A8AEFB6EE7--

.
