220 28137 <d31e50f3-4d9a-40e0-009a-17b7cad7f497@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: Re: Implicit function template arguments enabling
 syntax, an alternative to abbreviated templates
Date: Wed, 7 Sep 2016 13:30:48 -0400
Lines: 170
Approved: news@gmane.org
Message-ID: <d31e50f3-4d9a-40e0-009a-17b7cad7f497@honermann.net>
References: <627640bf-62bf-491e-bea9-f76eec0033ec@isocpp.org>
 <d114cdd9-77c1-43ce-8fdd-522422234155@isocpp.org>
 <0c4a29e2-b327-4957-9120-2fbe623a6ca3@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative;
 boundary="------------5CE8B091D6CEC24C48FB1278"
X-Trace: blaine.gmane.org 1473269458 27870 195.159.176.226 (7 Sep 2016 17:30:58 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Wed, 7 Sep 2016 17:30:58 +0000 (UTC)
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101
 Thunderbird/45.2.0
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDBNXSHG6UDBBTE5YG7AKGQE6SHU6LQ@isocpp.org Wed Sep 07 19:30:53 2016
Return-path: <std-proposals+bncBDBNXSHG6UDBBTE5YG7AKGQE6SHU6LQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ua0-f200.google.com ([209.85.217.200])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBDBNXSHG6UDBBTE5YG7AKGQE6SHU6LQ@isocpp.org>)
	id 1bhggV-0006cD-Tz
	for gclcip-std-proposals@m.gmane.org; Wed, 07 Sep 2016 19:30:52 +0200
Original-Received: by mail-ua0-f200.google.com with SMTP id 71sf41787931uag.0
        for <gclcip-std-proposals@m.gmane.org>; Wed, 07 Sep 2016 10:30:53 -0700 (PDT)
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=UUyMGITAyKJWTrYtJdGNZ9+WkF5qb84zVvbkGtfcnoc=;
        b=SZtGsHotxRFx9yDBIIaW2nxBdxOSvLhldzUm3HST1Ow9j1dGaJtyROJzatRHc070LW
         UKI1KreHwxfSOUve0pcMOxFAWIR5bKnziu1OM2mfuCe7KwBRzagadzPe7X/WFcrKdLdY
         TfvdZxgoZReVzWYPJ2Zu5AvGIbWyXDVSiVHFGL4FI4KJHtepg+duuDX46JlkyPX7J7Js
         oVN5nCnuLbUapBvZueGcBNImgf7vCFKBmoKVlzoNLov+ZD3aTPSxQ1zSSZbPeBiUOjf5
         rp7yJgknLZGkYLFEEul+D9V+a2ar6aLI1ScDjMQ2G1ei0UeRoQdRmcs3hPzRSeyhjKhy
         yycw==
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=UUyMGITAyKJWTrYtJdGNZ9+WkF5qb84zVvbkGtfcnoc=;
        b=Kh+D6C2PMCm1QnyZect7/TOvFNXiSO5Rt6JGyWvQus3OWMwtraQd5axugblkw2sbP9
         1UFNptN7vS/oTLdTueurpc2fuXEB/MquxKglRjRbRpX6ihFxphqYbELx0PvFDtuPVpxn
         k4tuUWNEbsRXI0IaFKtjTz5OMwyApu2uwdG0lIwcPZl+Ki90HlmAK3qNqdaWQ08S3afN
         UNBMkILb+n4G0Yhvut6+sof3zC+0ugEZqHb3234+4/sWrTiSYYBb7m390Ijtvjy2WY7Q
         zRlZG2OqVhy+2d2Fj5uGbZIwBxA3tGKjNgKEBqOja3gUZKj4Xat+f8aPNZurO3uvgVbL
         vdNA==
X-Gm-Message-State: AE9vXwOwIZiwtlTPSntiSmwXWaYt+I7jBoRz5CSvXJlBvhkitmsrTdyi21gKOVWyBccnZw==
X-Received: by 10.237.53.75 with SMTP id b11mr39799749qte.4.1473269452952;
        Wed, 07 Sep 2016 10:30:52 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.157.62.138 with SMTP id b10ls810630otc.21.gmail; Wed, 07 Sep
 2016 10:30:51 -0700 (PDT)
X-Received: by 10.200.56.3 with SMTP id q3mr24946466qtb.21.1473269451789;
        Wed, 07 Sep 2016 10:30:51 -0700 (PDT)
Original-Received: from smtp67.iad3a.emailsrvr.com (smtp67.iad3a.emailsrvr.com. [173.203.187.67])
        by mx.google.com with ESMTPS id b139si1542227qkc.297.2016.09.07.10.30.51
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Wed, 07 Sep 2016 10:30:51 -0700 (PDT)
Received-SPF: neutral (google.com: 173.203.187.67 is neither permitted nor denied by best guess record for domain of tom@honermann.net) client-ip=173.203.187.67;
Original-Received: from smtp17.relay.iad3a.emailsrvr.com (localhost [127.0.0.1])
	by smtp17.relay.iad3a.emailsrvr.com (SMTP Server) with ESMTP id 53AE4A02C7
	for <std-proposals@isocpp.org>; Wed,  7 Sep 2016 13:30:51 -0400 (EDT)
X-Auth-ID: tom@honermann.net
Original-Received: by smtp17.relay.iad3a.emailsrvr.com (Authenticated sender: tom-AT-honermann.net) with ESMTPSA id B0AF0A02C3
	for <std-proposals@isocpp.org>; Wed,  7 Sep 2016 13:30:50 -0400 (EDT)
X-Sender-Id: tom@honermann.net
Original-Received: from [10.12.197.214] (us02-rap-1.synopsys.com [198.182.60.251])
	(using TLSv1.2 with cipher DHE-RSA-AES128-SHA)
	by 0.0.0.0:587 (trex/5.7.7);
	Wed, 07 Sep 2016 13:30:51 -0400
In-Reply-To: <0c4a29e2-b327-4957-9120-2fbe623a6ca3@isocpp.org>
X-Original-Sender: tom@honermann.net
X-Original-Authentication-Results: mx.google.com;       spf=neutral
 (google.com: 173.203.187.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:28137
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/28137>

This is a multi-part message in MIME format.
--------------5CE8B091D6CEC24C48FB1278
Content-Type: text/plain; charset=UTF-8; format=flowed

On 9/7/2016 1:13 PM, Ivan G. wrote:
> Thanks for the answers! I'll correct the syntax a bit.
>
>     I'm not sure I understand what the point of the `...` part is.
>
>     One of the primary problems (to me) with the fully terse template
>     function syntax is that it declares a template function without
>     telling the user that they've done that. So it seems to me that it
>     is enough to simply use the `template` keyword:
>
>     |
>     template<>
>     voidfoo(autox);
>     |
>
>     I just don't see a real need to have the `...` there, just to say
>     that the parameter list will also add template arguments. That can
>     be implicit.
>
>
> AFAIK plain template<> syntax is already used for explicit function 
> template specializations. Forgive me if I'm wrong, but such a 
> specialization is not considered a template but rather a function.
>
> template <..., typename T>
> void foo2(T x, auto y)
> {
> }
>
> foo2<int>(42, 42); // OK
> foo2<bool, int>(42, false); // OK
>
> If explicit template parameters are allowed for auto arguments, then 
> they must have some specific order in which they appear in template 
> argument list. In this case, an ellipsis may be used to adjust their 
> appearance by placing it in the beginning or even in the middle.

The Concepts TS specifies the order for invented template parameters.  
See N4553 [1] [dcl.fct] 8.3.5 p16-17.

Tom.

[1]: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4553.pdf

-- 
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/d31e50f3-4d9a-40e0-009a-17b7cad7f497%40honermann.net.

--------------5CE8B091D6CEC24C48FB1278
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 9/7/2016 1:13 PM, Ivan G. wrote:<br>
    </div>
    <blockquote
      cite=3D"mid:0c4a29e2-b327-4957-9120-2fbe623a6ca3@isocpp.org"
      type=3D"cite">
      <div dir=3D"ltr">
        <div>Thanks for the answers! I'll correct the syntax a bit.</div>
        <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">I'm not sure I understand what the point of the
            `...` part is.<br>
            <br>
            One of the primary problems (to me) with the fully terse
            template function syntax is that it declares a template
            function without telling the user that they've done that. So
            it seems to me that it is enough to simply use the
            `template` keyword:<br>
            <br>
            <div
style=3D"background-color:rgb(250,250,250);border-color:rgb(187,187,187);bo=
rder-style:solid;border-width:1px;word-wrap:break-word"><code>
                <div><span style=3D"color:#008">template</span><span
                    style=3D"color:#660">&lt;&gt;</span><span
                    style=3D"color:#000"><br>
                  </span><span style=3D"color:#008">void</span><span
                    style=3D"color:#000"> foo</span><span
                    style=3D"color:#660">(</span><span style=3D"color:#008"=
>auto</span><span
                    style=3D"color:#000"> x</span><span style=3D"color:#660=
">);</span><span
                    style=3D"color:#000"><br>
                  </span></div>
              </code></div>
            <br>
            I just don't see a real need to have the `...` there, just
            to say that the parameter list will also add template
            arguments. That can be implicit.<br>
          </div>
        </blockquote>
        <div><br>
        </div>
        <div>AFAIK plain <font face=3D"courier new,monospace">template&lt;&=
gt;</font>=C2=A0syntax
          is already used for explicit function template
          specializations. Forgive me if I'm wrong, but such a
          specialization is not considered a template but rather a
          function.</div>
        <div><br>
        </div>
        <div><font face=3D"courier new,monospace">template &lt;...,
            typename T&gt;</font></div>
        <div><font face=3D"courier new,monospace">void foo2(T x, auto y)<br=
>
          </font></div>
        <div><font face=3D"courier new,monospace">{<br>
          </font></div>
        <div><font face=3D"courier new,monospace">}<br>
          </font></div>
        <div><font face=3D"courier new,monospace"><br>
          </font></div>
        <div><font face=3D"courier new,monospace">foo2&lt;int&gt;(42, 42);
            // OK<br>
          </font></div>
        <div><font face=3D"courier new,monospace">foo2&lt;bool,
            int&gt;(42, false); // OK<br>
          </font></div>
        <div><br>
        </div>
        <div>If explicit template parameters are allowed for auto
          arguments, then they must have some specific order in which
          they appear in template argument list. In this case, an
          ellipsis may be used to adjust their appearance by placing it
          in the beginning or even in the middle.</div>
      </div>
    </blockquote>
    <br>
    The Concepts TS specifies the order for invented template
    parameters.=C2=A0 See N4553 [1] [dcl.fct] 8.3.5 p16-17.<br>
    <br>
    Tom.<br>
    <br>
    [1]:
    <a class=3D"moz-txt-link-freetext" href=3D"http://www.open-std.org/jtc1=
/sc22/wg21/docs/papers/2015/n4553.pdf">http://www.open-std.org/jtc1/sc22/wg=
21/docs/papers/2015/n4553.pdf</a><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/d31e50f3-4d9a-40e0-009a-17b7cad7f497%=
40honermann.net?utm_medium=3Demail&utm_source=3Dfooter">https://groups.goog=
le.com/a/isocpp.org/d/msgid/std-proposals/d31e50f3-4d9a-40e0-009a-17b7cad7f=
497%40honermann.net</a>.<br />

--------------5CE8B091D6CEC24C48FB1278--

.
