Topic: Concepts shorthand & short-form notations: make


Author: =?UTF-8?Q?Micha=C5=82_Dominiak?= <griwes@griwes.info>
Date: Fri, 24 Feb 2017 07:23:50 +0000
Raw View
--001a1143ea10174c320549419d25
Content-Type: text/plain; charset=UTF-8

You've touched on a topic of a heated discussion on the reflectors. There's
been a suggestion to use `<Concept>` instead of `Concept` when using it as
a type specifier. The variant of the syntax you're proposing might be
prettier than that, even if uglier.

Though the concerns on the reflector were that it's not possible to
immediately know whether `void foo(Foo &&)` can take an lvalue or not (so
whether Foo is a concept or not), I think this post further reinforces the
point of view of some members of the committee that the fully abbreviated
syntax is indeed confusing for the users (in what I count from the last
couple of days is at least three ways).

Bjarne seems to think that the fully abbreviated syntax is necessary and
will make the language more helpful for newcomers. Based on all the posts
on this topic that've been appearing, I don't think that is true.

On Fri, Feb 24, 2017, 7:54 AM TONGARI J <tongari95@gmail.com> wrote:

> A constrained template is written in this way (verbose):
> template<typename T>
>     requires ConceptName<T>
> void algo(T const&);
>
> In p0557r0, it mentions shorthand notation:
> template<ConceptName T>
> void algo(T const&);
>
> And short-form notation:
> void algo(ConceptName const&);
>
> While C++17 introduces template <auto v>, so what does template<Integer I>
> mean? should `I` be an auto-deduced template non-type arg? or should it be
> a template type arg constrained by Integer? Either way, it's confusing.
>
> I think we'd better separate the domains of types & values:
>
> A shorthand notation becomes:
> template<typename:ConceptName T>
> void algo(T const&);
> Note that typename & class is interchangeable here.
>
> A short-form notation becomes:
> void algo(auto:ConceptName const&);
>
> Note that in this way, it's obvious that if 2 more args have the same
> Concept, they may deduce to different types, just as non-constrained auto.
> void algo(auto:ConceptName const& a, auto:ConceptName const& b);
>
> Although it's little more verbose that the original ones, I think it adds
> great clarity to the code while still keeps the brevity.
> Has similar idea been discussed before?
>
> --
> 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/88843922-dd0d-4b59-af78-d1dccbdc7a7b%40isocpp.org
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/88843922-dd0d-4b59-af78-d1dccbdc7a7b%40isocpp.org?utm_medium=email&utm_source=footer>
> .
>

--
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/CAPCFJdR9AiyYFOVBQu5Be7GAuCY5PPoGKHc9rCUNbtLSSuv6Fg%40mail.gmail.com.

--001a1143ea10174c320549419d25
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<p dir=3D"ltr">You&#39;ve touched on a topic of a heated discussion on the =
reflectors. There&#39;s been a suggestion to use `&lt;Concept&gt;` instead =
of `Concept` when using it as a type specifier. The variant of the syntax y=
ou&#39;re proposing might be prettier than that, even if uglier.</p>
<p dir=3D"ltr">Though the concerns on the reflector were that it&#39;s not =
possible to immediately know whether `void foo(Foo &amp;&amp;)` can take an=
 lvalue or not (so whether Foo is a concept or not), I think this post furt=
her reinforces the point of view of some members of the committee that the =
fully abbreviated syntax is indeed confusing for the users (in what I count=
 from the last couple of days is at least three ways).</p>
<p dir=3D"ltr">Bjarne seems to think that the fully abbreviated syntax is n=
ecessary and will make the language more helpful for newcomers. Based on al=
l the posts on this topic that&#39;ve been appearing, I don&#39;t think tha=
t is true.</p>
<br><div class=3D"gmail_quote"><div dir=3D"ltr">On Fri, Feb 24, 2017, 7:54 =
AM TONGARI J &lt;<a href=3D"mailto:tongari95@gmail.com">tongari95@gmail.com=
</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:=
0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr" cl=
ass=3D"gmail_msg"><div class=3D"gmail_msg">A constrained template is writte=
n in this way (verbose):</div><div class=3D"m_-5722589819680241257prettypri=
nt gmail_msg" style=3D"background-color:rgb(250,250,250);border-color:rgb(1=
87,187,187);border-style:solid;border-width:1px;word-wrap:break-word"><code=
 class=3D"m_-5722589819680241257prettyprint gmail_msg"><div class=3D"m_-572=
2589819680241257subprettyprint gmail_msg"><span style=3D"color:#008" class=
=3D"m_-5722589819680241257styled-by-prettify gmail_msg">template</span><spa=
n style=3D"color:#660" class=3D"m_-5722589819680241257styled-by-prettify gm=
ail_msg">&lt;</span><span style=3D"color:#008" class=3D"m_-5722589819680241=
257styled-by-prettify gmail_msg">typename</span><span style=3D"color:#000" =
class=3D"m_-5722589819680241257styled-by-prettify gmail_msg"> T</span><span=
 style=3D"color:#660" class=3D"m_-5722589819680241257styled-by-prettify gma=
il_msg">&gt;</span><span style=3D"color:#000" class=3D"m_-57225898196802412=
57styled-by-prettify gmail_msg"><br class=3D"gmail_msg">=C2=A0 =C2=A0 requi=
res </span><span style=3D"color:#606" class=3D"m_-5722589819680241257styled=
-by-prettify gmail_msg">ConceptName</span><span style=3D"color:#660" class=
=3D"m_-5722589819680241257styled-by-prettify gmail_msg">&lt;</span><span st=
yle=3D"color:#000" class=3D"m_-5722589819680241257styled-by-prettify gmail_=
msg">T</span><span style=3D"color:#660" class=3D"m_-5722589819680241257styl=
ed-by-prettify gmail_msg">&gt;</span><span style=3D"color:#000" class=3D"m_=
-5722589819680241257styled-by-prettify gmail_msg"><br class=3D"gmail_msg"><=
/span><span style=3D"color:#008" class=3D"m_-5722589819680241257styled-by-p=
rettify gmail_msg">void</span><span style=3D"color:#000" class=3D"m_-572258=
9819680241257styled-by-prettify gmail_msg"> algo</span><span style=3D"color=
:#660" class=3D"m_-5722589819680241257styled-by-prettify gmail_msg">(</span=
><span style=3D"color:#000" class=3D"m_-5722589819680241257styled-by-pretti=
fy gmail_msg">T </span><span style=3D"color:#008" class=3D"m_-5722589819680=
241257styled-by-prettify gmail_msg">const</span><span style=3D"color:#660" =
class=3D"m_-5722589819680241257styled-by-prettify gmail_msg">&amp;);</span>=
</div></code></div><br class=3D"gmail_msg"><div class=3D"gmail_msg"><div cl=
ass=3D"gmail_msg">In=C2=A0p0557r0, it mentions=C2=A0shorthand=C2=A0notation=
:</div></div><div class=3D"gmail_msg"><div class=3D"m_-5722589819680241257p=
rettyprint gmail_msg" style=3D"background-color:rgb(250,250,250);border-col=
or:rgb(187,187,187);border-style:solid;border-width:1px;word-wrap:break-wor=
d"><code class=3D"m_-5722589819680241257prettyprint gmail_msg"><div class=
=3D"m_-5722589819680241257subprettyprint gmail_msg"><span style=3D"color:#0=
08" class=3D"m_-5722589819680241257styled-by-prettify gmail_msg">template</=
span><span style=3D"color:#660" class=3D"m_-5722589819680241257styled-by-pr=
ettify gmail_msg">&lt;</span><span style=3D"color:#606" class=3D"m_-5722589=
819680241257styled-by-prettify gmail_msg">ConceptName</span><span style=3D"=
color:#000" class=3D"m_-5722589819680241257styled-by-prettify gmail_msg"> T=
</span><span style=3D"color:#660" class=3D"m_-5722589819680241257styled-by-=
prettify gmail_msg">&gt;</span><span style=3D"color:#000" class=3D"m_-57225=
89819680241257styled-by-prettify gmail_msg"><br class=3D"gmail_msg"></span>=
<span style=3D"color:#008" class=3D"m_-5722589819680241257styled-by-prettif=
y gmail_msg">void</span><span style=3D"color:#000" class=3D"m_-572258981968=
0241257styled-by-prettify gmail_msg"> algo</span><span style=3D"color:#660"=
 class=3D"m_-5722589819680241257styled-by-prettify gmail_msg">(</span><span=
 style=3D"color:#000" class=3D"m_-5722589819680241257styled-by-prettify gma=
il_msg">T </span><span style=3D"color:#008" class=3D"m_-5722589819680241257=
styled-by-prettify gmail_msg">const</span><span style=3D"color:#660" class=
=3D"m_-5722589819680241257styled-by-prettify gmail_msg">&amp;);</span></div=
></code></div><span class=3D"m_-5722589819680241257styled-by-prettify gmail=
_msg" style=3D"font-family:monospace;background-color:rgb(250,250,250);colo=
r:rgb(102,102,0)"><div class=3D"gmail_msg"><span class=3D"m_-57225898196802=
41257styled-by-prettify gmail_msg" style=3D"font-family:monospace;backgroun=
d-color:rgb(250,250,250);color:rgb(102,102,0)"><br class=3D"gmail_msg"></sp=
an></div></span>And short-form notation:</div><div class=3D"gmail_msg"><div=
 class=3D"m_-5722589819680241257prettyprint gmail_msg" style=3D"background-=
color:rgb(250,250,250);border-color:rgb(187,187,187);border-style:solid;bor=
der-width:1px;word-wrap:break-word"><code class=3D"m_-5722589819680241257pr=
ettyprint gmail_msg"><div class=3D"m_-5722589819680241257subprettyprint gma=
il_msg"><span style=3D"color:#008" class=3D"m_-5722589819680241257styled-by=
-prettify gmail_msg">void</span><span style=3D"color:#000" class=3D"m_-5722=
589819680241257styled-by-prettify gmail_msg"> algo</span><span style=3D"col=
or:#660" class=3D"m_-5722589819680241257styled-by-prettify gmail_msg">(</sp=
an><span style=3D"color:#606" class=3D"m_-5722589819680241257styled-by-pret=
tify gmail_msg">ConceptName</span><span style=3D"color:#000" class=3D"m_-57=
22589819680241257styled-by-prettify gmail_msg"> </span><span style=3D"color=
:#008" class=3D"m_-5722589819680241257styled-by-prettify gmail_msg">const</=
span><span style=3D"color:#660" class=3D"m_-5722589819680241257styled-by-pr=
ettify gmail_msg">&amp;);</span></div></code></div><span class=3D"m_-572258=
9819680241257styled-by-prettify gmail_msg" style=3D"font-family:monospace;b=
ackground-color:rgb(250,250,250);color:rgb(102,102,0)"><br class=3D"gmail_m=
sg"></span>While C++17 introduces=C2=A0<span class=3D"m_-572258981968024125=
7styled-by-prettify gmail_msg" style=3D"color:rgb(0,0,136)">template</span>=
<span class=3D"m_-5722589819680241257styled-by-prettify gmail_msg" style=3D=
"color:rgb(0,0,0)">=C2=A0</span><span class=3D"m_-5722589819680241257styled=
-by-prettify gmail_msg" style=3D"color:rgb(102,102,0)">&lt;</span><span cla=
ss=3D"m_-5722589819680241257styled-by-prettify gmail_msg" style=3D"color:rg=
b(0,0,136)">auto</span><span class=3D"m_-5722589819680241257styled-by-prett=
ify gmail_msg" style=3D"color:rgb(0,0,0)">=C2=A0v</span><span class=3D"m_-5=
722589819680241257styled-by-prettify gmail_msg" style=3D"color:rgb(102,102,=
0)">&gt;</span>, so what does=C2=A0<span class=3D"m_-5722589819680241257sty=
led-by-prettify gmail_msg" style=3D"font-family:monospace;background-color:=
rgb(250,250,250);color:rgb(0,0,136)">template</span><span class=3D"m_-57225=
89819680241257styled-by-prettify gmail_msg" style=3D"font-family:monospace;=
background-color:rgb(250,250,250);color:rgb(102,102,0)">&lt;</span><span cl=
ass=3D"m_-5722589819680241257styled-by-prettify gmail_msg" style=3D"font-fa=
mily:monospace;background-color:rgb(250,250,250)"><font color=3D"#660066" c=
lass=3D"gmail_msg">Integer I</font></span><span class=3D"m_-572258981968024=
1257styled-by-prettify gmail_msg" style=3D"font-family:monospace;background=
-color:rgb(250,250,250);color:rgb(102,102,0)">&gt;</span> mean? should `I` =
be an auto-deduced template non-type arg? or should it be a template type a=
rg constrained by Integer? Either way, it&#39;s confusing.</div><div class=
=3D"gmail_msg"><br class=3D"gmail_msg"></div><div class=3D"gmail_msg">I thi=
nk we&#39;d better separate the domains of types &amp; values:</div><div cl=
ass=3D"gmail_msg"><br class=3D"gmail_msg"></div><div class=3D"gmail_msg">A =
shorthand=C2=A0notation becomes:</div><div class=3D"m_-5722589819680241257p=
rettyprint gmail_msg" style=3D"background-color:rgb(250,250,250);border-col=
or:rgb(187,187,187);border-style:solid;border-width:1px;word-wrap:break-wor=
d"><code class=3D"m_-5722589819680241257prettyprint gmail_msg"><div class=
=3D"m_-5722589819680241257subprettyprint gmail_msg"><span style=3D"color:#0=
08" class=3D"m_-5722589819680241257styled-by-prettify gmail_msg">template</=
span><span style=3D"color:#660" class=3D"m_-5722589819680241257styled-by-pr=
ettify gmail_msg">&lt;</span><span style=3D"color:#008" class=3D"m_-5722589=
819680241257styled-by-prettify gmail_msg">typename</span><span style=3D"col=
or:#660" class=3D"m_-5722589819680241257styled-by-prettify gmail_msg">:</sp=
an><span style=3D"color:#606" class=3D"m_-5722589819680241257styled-by-pret=
tify gmail_msg">ConceptName</span><span style=3D"color:#000" class=3D"m_-57=
22589819680241257styled-by-prettify gmail_msg"> T</span><span style=3D"colo=
r:#660" class=3D"m_-5722589819680241257styled-by-prettify gmail_msg">&gt;</=
span><span style=3D"color:#000" class=3D"m_-5722589819680241257styled-by-pr=
ettify gmail_msg"><br class=3D"gmail_msg"></span><span style=3D"color:#008"=
 class=3D"m_-5722589819680241257styled-by-prettify gmail_msg">void</span><s=
pan style=3D"color:#000" class=3D"m_-5722589819680241257styled-by-prettify =
gmail_msg"> algo</span><span style=3D"color:#660" class=3D"m_-5722589819680=
241257styled-by-prettify gmail_msg">(</span><span style=3D"color:#000" clas=
s=3D"m_-5722589819680241257styled-by-prettify gmail_msg">T </span><span sty=
le=3D"color:#008" class=3D"m_-5722589819680241257styled-by-prettify gmail_m=
sg">const</span><span style=3D"color:#660" class=3D"m_-5722589819680241257s=
tyled-by-prettify gmail_msg">&amp;);</span></div></code></div>Note that=C2=
=A0<span style=3D"color:rgb(0,0,136);font-family:monospace;background-color=
:rgb(250,250,250)" class=3D"gmail_msg">typename=C2=A0</span>&amp;=C2=A0<spa=
n style=3D"color:rgb(0,0,136)" class=3D"gmail_msg">class=C2=A0</span>is int=
erchangeable here.<div class=3D"gmail_msg"><span class=3D"m_-57225898196802=
41257styled-by-prettify gmail_msg" style=3D"font-family:monospace;backgroun=
d-color:rgb(250,250,250);color:rgb(102,102,0)"><br class=3D"gmail_msg"></sp=
an></div><div class=3D"gmail_msg">A short-form notation becomes:</div><div =
class=3D"gmail_msg"><div class=3D"m_-5722589819680241257prettyprint gmail_m=
sg" style=3D"background-color:rgb(250,250,250);border-color:rgb(187,187,187=
);border-style:solid;border-width:1px;word-wrap:break-word"><code class=3D"=
m_-5722589819680241257prettyprint gmail_msg"><div class=3D"m_-5722589819680=
241257subprettyprint gmail_msg"><span style=3D"color:#008" class=3D"m_-5722=
589819680241257styled-by-prettify gmail_msg">void</span><span style=3D"colo=
r:#000" class=3D"m_-5722589819680241257styled-by-prettify gmail_msg"> algo<=
/span><span style=3D"color:#660" class=3D"m_-5722589819680241257styled-by-p=
rettify gmail_msg">(</span><span style=3D"color:#008" class=3D"m_-572258981=
9680241257styled-by-prettify gmail_msg">auto</span><span style=3D"color:#66=
0" class=3D"m_-5722589819680241257styled-by-prettify gmail_msg">:</span><sp=
an style=3D"color:#606" class=3D"m_-5722589819680241257styled-by-prettify g=
mail_msg">ConceptName</span><span style=3D"color:#000" class=3D"m_-57225898=
19680241257styled-by-prettify gmail_msg"> </span><span style=3D"color:#008"=
 class=3D"m_-5722589819680241257styled-by-prettify gmail_msg">const</span><=
span style=3D"color:#660" class=3D"m_-5722589819680241257styled-by-prettify=
 gmail_msg">&amp;);</span></div></code></div></div><div class=3D"gmail_msg"=
><br class=3D"gmail_msg"></div><div class=3D"gmail_msg">Note that in this w=
ay, it&#39;s obvious that if 2 more args have the same Concept, they may de=
duce to different types, just as non-constrained auto.</div><div class=3D"g=
mail_msg"><div class=3D"m_-5722589819680241257prettyprint gmail_msg" style=
=3D"background-color:rgb(250,250,250);border-color:rgb(187,187,187);border-=
style:solid;border-width:1px;word-wrap:break-word"><code class=3D"m_-572258=
9819680241257prettyprint gmail_msg"><div class=3D"m_-5722589819680241257sub=
prettyprint gmail_msg"><span style=3D"color:#008" class=3D"m_-5722589819680=
241257styled-by-prettify gmail_msg">void</span><span style=3D"color:#000" c=
lass=3D"m_-5722589819680241257styled-by-prettify gmail_msg"> algo</span><sp=
an style=3D"color:#660" class=3D"m_-5722589819680241257styled-by-prettify g=
mail_msg">(</span><span style=3D"color:#008" class=3D"m_-572258981968024125=
7styled-by-prettify gmail_msg">auto</span><span style=3D"color:#660" class=
=3D"m_-5722589819680241257styled-by-prettify gmail_msg">:</span><span style=
=3D"color:#606" class=3D"m_-5722589819680241257styled-by-prettify gmail_msg=
">ConceptName</span><span style=3D"color:#000" class=3D"m_-5722589819680241=
257styled-by-prettify gmail_msg"> </span><span style=3D"color:#008" class=
=3D"m_-5722589819680241257styled-by-prettify gmail_msg">const</span><span s=
tyle=3D"color:#660" class=3D"m_-5722589819680241257styled-by-prettify gmail=
_msg">&amp;</span><span style=3D"color:#000" class=3D"m_-572258981968024125=
7styled-by-prettify gmail_msg"> a</span><span style=3D"color:#660" class=3D=
"m_-5722589819680241257styled-by-prettify gmail_msg">,</span><span style=3D=
"color:#000" class=3D"m_-5722589819680241257styled-by-prettify gmail_msg"> =
</span><span style=3D"color:#008" class=3D"m_-5722589819680241257styled-by-=
prettify gmail_msg">auto</span><span style=3D"color:#660" class=3D"m_-57225=
89819680241257styled-by-prettify gmail_msg">:</span><span style=3D"color:#6=
06" class=3D"m_-5722589819680241257styled-by-prettify gmail_msg">ConceptNam=
e</span><span style=3D"color:#000" class=3D"m_-5722589819680241257styled-by=
-prettify gmail_msg"> </span><span style=3D"color:#008" class=3D"m_-5722589=
819680241257styled-by-prettify gmail_msg">const</span><span style=3D"color:=
#660" class=3D"m_-5722589819680241257styled-by-prettify gmail_msg">&amp;</s=
pan><span style=3D"color:#000" class=3D"m_-5722589819680241257styled-by-pre=
ttify gmail_msg"> b</span><span style=3D"color:#660" class=3D"m_-5722589819=
680241257styled-by-prettify gmail_msg">);</span></div></code></div><span st=
yle=3D"background-color:rgb(250,250,250);color:rgb(102,102,0);font-family:m=
onospace" class=3D"gmail_msg"><br class=3D"gmail_msg"></span></div>Although=
 it&#39;s little more verbose that the original ones, I think it adds great=
 clarity to the code while still keeps the brevity.<br class=3D"gmail_msg">=
<div class=3D"gmail_msg">Has similar idea been discussed before?</div></div=
>

<p class=3D"gmail_msg"></p>

-- <br class=3D"gmail_msg">
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br class=3D"gmail_msg=
">
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" class=3D"gm=
ail_msg" target=3D"_blank">std-proposals+unsubscribe@isocpp.org</a>.<br cla=
ss=3D"gmail_msg">
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" class=3D"gmail_msg" target=3D"_blank">std-proposals@isocpp.org</a>.<b=
r class=3D"gmail_msg">
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/88843922-dd0d-4b59-af78-d1dccbdc7a7b%=
40isocpp.org?utm_medium=3Demail&amp;utm_source=3Dfooter" class=3D"gmail_msg=
" target=3D"_blank">https://groups.google.com/a/isocpp.org/d/msgid/std-prop=
osals/88843922-dd0d-4b59-af78-d1dccbdc7a7b%40isocpp.org</a>.<br class=3D"gm=
ail_msg">
</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/CAPCFJdR9AiyYFOVBQu5Be7GAuCY5PPoGKHc9=
rCUNbtLSSuv6Fg%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">htt=
ps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAPCFJdR9AiyYFOVB=
Qu5Be7GAuCY5PPoGKHc9rCUNbtLSSuv6Fg%40mail.gmail.com</a>.<br />

--001a1143ea10174c320549419d25--

.


Author: "Vicente J. Botet Escriba" <vicente.botet@wanadoo.fr>
Date: Fri, 24 Feb 2017 09:40:53 +0100
Raw View
This is a multi-part message in MIME format.
--------------7AB55D22893FEE18197695C9
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable

Le 24/02/2017 =C3=A0 07:54, TONGARI J a =C3=A9crit :
> A constrained template is written in this way (verbose):
> |
> template<typenameT>
>     requires ConceptName<T>
> voidalgo(T const&);
> |
>
> In p0557r0, it mentions shorthand notation:
> |
> template<ConceptNameT>
> voidalgo(T const&);
> |
>
> And short-form notation:
> |
> voidalgo(ConceptNameconst&);
> |
>
> While C++17 introduces template<auto v>, so what does template<Integer=20
> I> mean? should `I` be an auto-deduced template non-type arg? or=20
> should it be a template type arg constrained by Integer? Either way,=20
> it's confusing.
I believe it would depend on what Integer is. If Integer is a type I is=20
a value, if Integer is a concept I is a type that satisfies the Integer=20
concept. Am I missing something?
I agree that this adds adds some syntactical confusion for the reader,=20
as now we need to see what Integer is before knowing what I is.

>
> I think we'd better separate the domains of types & values:
>
> A shorthand notation becomes:
> |
> template<typename:ConceptNameT>
> voidalgo(T const&);
> |
> Note that typename & class is interchangeable here.
Today the language has been using typename whenever we need to make=20
explicit that something dependent is a type. But here T is not dependent.

When you want an unconstrained type you use template <typename T>.
You are suggesting in the short-form  auto::ConceptName to mean a=20
deduced type satisfying ConceptName, so maybe the natural way would be=20
<typename T:ConceptName>.
>
> A short-form notation becomes:
> |
> voidalgo(auto:ConceptNameconst&);
> |
>
I've suggested  (just yesterday on the reflector) a syntax that while=20
different from yours should be equivalent. I have also thought to=20
T:Concept, but as brace-introducers take the form Concept{T}, I believe=20
that it is more coherent, but may be I'm missing something evident that=20
would force to have a different syntax to help the parser.

T:Concept will be better than the current situation as well.

If you need a T

|
voidalgo(ConceptName{T}const&);
|

and if you don't need the T, it could be

|
voidalgo(ConceptName{}const&);
|
or
|
voidalgo(ConceptName{auto}const&);
|

The last is explicit with the current generic lambdas. Just deduce the type=
..

I find
|
voidalgo(ConceptName{}const&);
|
has the advantage to state clearly that this is not a usual function.

The absence of a type would men auto.

> Note that in this way, it's obvious that if 2 more args have the same=20
> Concept, they may deduce to different types, just as non-constrained auto=
..
> |
> voidalgo(auto:ConceptNameconst&a,auto:ConceptNameconst&b);
> |
>
Hmm, how do you say that the two parameters have the same type?
|
voidalgo(T:ConceptNameconst&a,Tconst&b);
|

With my suggestion:

Explicitly possibly different types
|
voidalgo(ConceptName{T} const&a,ConceptName{U} const&b);
|

Explicitly same type
|
voidalgo(ConceptName{T} const&a,Tconst&b);
|

What could mean

|
voidalgo(ConceptName{} const&a,ConceptName{} const&b);
|
or
|
voidalgo(ConceptName{auto} const&a,ConceptName{auto} const&b);
|


IMO, this should not be supported as it is not explicit enough or
possibly different types as generic lambdas semantics are possible=20
different types when auto is used.
Note that stating that the types are the same is even shorter. My=20
preference would be different types.

Could we use auto as the True concept?

|
voidalgo(auto{T} const&a);
|

This adds more verbosity but states clearly that this is not a usual=20
function.
This could be the short-form of C++17 templates.


Note that with the current Concept TS the type of the parameters are the=20
same :(
|
voidalgo(ConceptNameconst&a,ConceptNameconst&b);
|

What could mean
|
voidalgo(ConceptName{T} const&a,ConceptName{} const&b);
|

IMO, this should not be supported as it is not explicit enough or
possibly different types as stating that the types are the same is even=20
shorter. My preference would be here different.

How all this extends to (generic) lambda expressions?

|
[](C{T} const&a);
|

I don't see any major issue.
|auto should the equivalent to auto{auto}: deduce the type without no=20
constraints|

|
[](autoconst&a);
|



> Although it's little more verbose that the original ones, I think it=20
> adds great clarity to the code while still keeps the brevity.
> Has similar idea been discussed before?
Yes.

Vicente

--=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/d2d696b3-5529-d801-3930-be458ebcde8a%40wanadoo.f=
r.

--------------7AB55D22893FEE18197695C9
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">Le 24/02/2017 =C3=A0 07:54, TONGARI J a
      =C3=A9crit=C2=A0:<br>
    </div>
    <blockquote
      cite=3D"mid:88843922-dd0d-4b59-af78-d1dccbdc7a7b@isocpp.org"
      type=3D"cite">
      <div dir=3D"ltr">
        <div>A constrained template is written in this way (verbose):</div>
        <div class=3D"prettyprint" style=3D"background-color: rgb(250, 250,
          250); border-color: rgb(187, 187, 187); border-style: solid;
          border-width: 1px; word-wrap: break-word;"><code
            class=3D"prettyprint">
            <div class=3D"subprettyprint"><span style=3D"color: #008;"
                class=3D"styled-by-prettify">template</span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">&lt;</s=
pan><span
                style=3D"color: #008;" class=3D"styled-by-prettify">typenam=
e</span><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> T</spa=
n><span
                style=3D"color: #660;" class=3D"styled-by-prettify">&gt;</s=
pan><span
                style=3D"color: #000;" class=3D"styled-by-prettify"><br>
                =C2=A0 =C2=A0 requires </span><span style=3D"color: #606;"
                class=3D"styled-by-prettify">ConceptName</span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">&lt;</s=
pan><span
                style=3D"color: #000;" class=3D"styled-by-prettify">T</span=
><span
                style=3D"color: #660;" class=3D"styled-by-prettify">&gt;</s=
pan><span
                style=3D"color: #000;" class=3D"styled-by-prettify"><br>
              </span><span style=3D"color: #008;"
                class=3D"styled-by-prettify">void</span><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> algo</=
span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">(</span=
><span
                style=3D"color: #000;" class=3D"styled-by-prettify">T </spa=
n><span
                style=3D"color: #008;" class=3D"styled-by-prettify">const</=
span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">&amp;);=
</span></div>
          </code></div>
        <br>
        <div>
          <div>In=C2=A0p0557r0, it mentions=C2=A0shorthand=C2=A0notation:</=
div>
        </div>
        <div>
          <div class=3D"prettyprint" style=3D"background-color: rgb(250,
            250, 250); border-color: rgb(187, 187, 187); border-style:
            solid; border-width: 1px; word-wrap: break-word;"><code
              class=3D"prettyprint">
              <div class=3D"subprettyprint"><span style=3D"color: #008;"
                  class=3D"styled-by-prettify">template</span><span
                  style=3D"color: #660;" class=3D"styled-by-prettify">&lt;<=
/span><span
                  style=3D"color: #606;" class=3D"styled-by-prettify">Conce=
ptName</span><span
                  style=3D"color: #000;" class=3D"styled-by-prettify"> T</s=
pan><span
                  style=3D"color: #660;" class=3D"styled-by-prettify">&gt;<=
/span><span
                  style=3D"color: #000;" class=3D"styled-by-prettify"><br>
                </span><span style=3D"color: #008;"
                  class=3D"styled-by-prettify">void</span><span
                  style=3D"color: #000;" class=3D"styled-by-prettify"> algo=
</span><span
                  style=3D"color: #660;" class=3D"styled-by-prettify">(</sp=
an><span
                  style=3D"color: #000;" class=3D"styled-by-prettify">T </s=
pan><span
                  style=3D"color: #008;" class=3D"styled-by-prettify">const=
</span><span
                  style=3D"color: #660;" class=3D"styled-by-prettify">&amp;=
);</span></div>
            </code></div>
          <span class=3D"styled-by-prettify" style=3D"font-family:
            monospace; background-color: rgb(250, 250, 250); color:
            rgb(102, 102, 0);">
            <div><span class=3D"styled-by-prettify" style=3D"font-family:
                monospace; background-color: rgb(250, 250, 250); color:
                rgb(102, 102, 0);"><br>
              </span></div>
          </span>And short-form notation:</div>
        <div>
          <div class=3D"prettyprint" style=3D"background-color: rgb(250,
            250, 250); border-color: rgb(187, 187, 187); border-style:
            solid; border-width: 1px; word-wrap: break-word;"><code
              class=3D"prettyprint">
              <div class=3D"subprettyprint"><span style=3D"color: #008;"
                  class=3D"styled-by-prettify">void</span><span
                  style=3D"color: #000;" class=3D"styled-by-prettify"> algo=
</span><span
                  style=3D"color: #660;" class=3D"styled-by-prettify">(</sp=
an><span
                  style=3D"color: #606;" class=3D"styled-by-prettify">Conce=
ptName</span><span
                  style=3D"color: #000;" class=3D"styled-by-prettify"> </sp=
an><span
                  style=3D"color: #008;" class=3D"styled-by-prettify">const=
</span><span
                  style=3D"color: #660;" class=3D"styled-by-prettify">&amp;=
);</span></div>
            </code></div>
          <span class=3D"styled-by-prettify" style=3D"font-family:
            monospace; background-color: rgb(250, 250, 250); color:
            rgb(102, 102, 0);"><br>
          </span>While C++17 introduces=C2=A0<span class=3D"styled-by-prett=
ify"
            style=3D"color: rgb(0, 0, 136);">template</span><span
            class=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0);">=C2=
=A0</span><span
            class=3D"styled-by-prettify" style=3D"color: rgb(102, 102, 0);"=
>&lt;</span><span
            class=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 136);">a=
uto</span><span
            class=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0);">=C2=
=A0v</span><span
            class=3D"styled-by-prettify" style=3D"color: rgb(102, 102, 0);"=
>&gt;</span>,
          so what does=C2=A0<span class=3D"styled-by-prettify"
            style=3D"font-family: monospace; background-color: rgb(250,
            250, 250); color: rgb(0, 0, 136);">template</span><span
            class=3D"styled-by-prettify" style=3D"font-family: monospace;
            background-color: rgb(250, 250, 250); color: rgb(102, 102,
            0);">&lt;</span><span class=3D"styled-by-prettify"
            style=3D"font-family: monospace; background-color: rgb(250,
            250, 250);"><font color=3D"#660066">Integer I</font></span><spa=
n
            class=3D"styled-by-prettify" style=3D"font-family: monospace;
            background-color: rgb(250, 250, 250); color: rgb(102, 102,
            0);">&gt;</span> mean? should `I` be an auto-deduced
          template non-type arg? or should it be a template type arg
          constrained by Integer? Either way, it's confusing.</div>
      </div>
    </blockquote>
    I believe it would depend on what Integer is. If Integer is a type I
    is a value, if Integer is a concept I is a type that satisfies the
    Integer concept. Am I missing something?<br>
    I agree that this adds adds some syntactical confusion for the
    reader, as now we need to see what Integer is before knowing what I
    is.<br>
    <br>
    <blockquote
      cite=3D"mid:88843922-dd0d-4b59-af78-d1dccbdc7a7b@isocpp.org"
      type=3D"cite">
      <div dir=3D"ltr">
        <div><br>
        </div>
        <div>I think we'd better separate the domains of types &amp;
          values:</div>
        <div><br>
        </div>
        <div>A shorthand=C2=A0notation becomes:</div>
        <div class=3D"prettyprint" style=3D"background-color: rgb(250, 250,
          250); border-color: rgb(187, 187, 187); border-style: solid;
          border-width: 1px; word-wrap: break-word;"><code
            class=3D"prettyprint">
            <div class=3D"subprettyprint"><span style=3D"color: #008;"
                class=3D"styled-by-prettify">template</span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">&lt;</s=
pan><span
                style=3D"color: #008;" class=3D"styled-by-prettify">typenam=
e</span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">:</span=
><span
                style=3D"color: #606;" class=3D"styled-by-prettify">Concept=
Name</span><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> T</spa=
n><span
                style=3D"color: #660;" class=3D"styled-by-prettify">&gt;</s=
pan><span
                style=3D"color: #000;" class=3D"styled-by-prettify"><br>
              </span><span style=3D"color: #008;"
                class=3D"styled-by-prettify">void</span><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> algo</=
span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">(</span=
><span
                style=3D"color: #000;" class=3D"styled-by-prettify">T </spa=
n><span
                style=3D"color: #008;" class=3D"styled-by-prettify">const</=
span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">&amp;);=
</span></div>
          </code></div>
        Note that=C2=A0<span style=3D"color: rgb(0, 0, 136); font-family:
          monospace; background-color: rgb(250, 250, 250);">typename=C2=A0<=
/span>&amp;=C2=A0<span
          style=3D"color: rgb(0, 0, 136);">class=C2=A0</span>is interchange=
able
        here.</div>
    </blockquote>
    Today the language has been using typename whenever we need to make
    explicit that something dependent is a type. But here T is not
    dependent.<br>
    <br>
    When you want an unconstrained type you use template &lt;typename
    T&gt;.<br>
    You are suggesting in the short-form=C2=A0 auto::ConceptName to mean a
    deduced type satisfying ConceptName, so maybe the natural way would
    be &lt;typename T:ConceptName&gt;.
    <blockquote
      cite=3D"mid:88843922-dd0d-4b59-af78-d1dccbdc7a7b@isocpp.org"
      type=3D"cite">
      <div dir=3D"ltr">
        <div><span class=3D"styled-by-prettify" style=3D"font-family:
            monospace; background-color: rgb(250, 250, 250); color:
            rgb(102, 102, 0);"><br>
          </span></div>
        <div>A short-form notation becomes:</div>
        <div>
          <div class=3D"prettyprint" style=3D"background-color: rgb(250,
            250, 250); border-color: rgb(187, 187, 187); border-style:
            solid; border-width: 1px; word-wrap: break-word;"><code
              class=3D"prettyprint">
              <div class=3D"subprettyprint"><span style=3D"color: #008;"
                  class=3D"styled-by-prettify">void</span><span
                  style=3D"color: #000;" class=3D"styled-by-prettify"> algo=
</span><span
                  style=3D"color: #660;" class=3D"styled-by-prettify">(</sp=
an><span
                  style=3D"color: #008;" class=3D"styled-by-prettify">auto<=
/span><span
                  style=3D"color: #660;" class=3D"styled-by-prettify">:</sp=
an><span
                  style=3D"color: #606;" class=3D"styled-by-prettify">Conce=
ptName</span><span
                  style=3D"color: #000;" class=3D"styled-by-prettify"> </sp=
an><span
                  style=3D"color: #008;" class=3D"styled-by-prettify">const=
</span><span
                  style=3D"color: #660;" class=3D"styled-by-prettify">&amp;=
);</span></div>
            </code></div>
        </div>
        <div><br>
        </div>
      </div>
    </blockquote>
    I've suggested=C2=A0 (just yesterday on the reflector) a syntax that
    while different from yours should be equivalent. I have also thought
    to T:Concept, but as brace-introducers take the form Concept{T}, I
    believe that it is more coherent, but may be I'm missing something
    evident that would force to have a different syntax to help the
    parser.<br>
    <br>
    T:Concept will be better than the current situation as well.<br>
    <br>
    If you need a T<br>
    <br>
    <div>
      <div class=3D"prettyprint" style=3D"background-color: rgb(250, 250,
        250); border-color: rgb(187, 187, 187); border-style: solid;
        border-width: 1px; word-wrap: break-word;"><code
          class=3D"prettyprint">
          <div class=3D"subprettyprint"><span style=3D"color: #008;"
              class=3D"styled-by-prettify">void</span><span style=3D"color:
              #000;" class=3D"styled-by-prettify"> algo</span><span
              style=3D"color: #660;" class=3D"styled-by-prettify">(</span><=
span
              style=3D"color: #008;" class=3D"styled-by-prettify"></span><s=
pan
              style=3D"color: #606;" class=3D"styled-by-prettify">ConceptNa=
me{T}</span><span
              style=3D"color: #000;" class=3D"styled-by-prettify"> </span><=
span
              style=3D"color: #008;" class=3D"styled-by-prettify">const</sp=
an><span
              style=3D"color: #660;" class=3D"styled-by-prettify">&amp;);</=
span></div>
        </code></div>
    </div>
    <br>
    and if you don't need the T, it could be <br>
    <br>
    <div>
      <div class=3D"prettyprint" style=3D"background-color: rgb(250, 250,
        250); border-color: rgb(187, 187, 187); border-style: solid;
        border-width: 1px; word-wrap: break-word;"><code
          class=3D"prettyprint">
          <div class=3D"subprettyprint"><span style=3D"color: #008;"
              class=3D"styled-by-prettify">void</span><span style=3D"color:
              #000;" class=3D"styled-by-prettify"> algo</span><span
              style=3D"color: #660;" class=3D"styled-by-prettify">(</span><=
span
              style=3D"color: #008;" class=3D"styled-by-prettify"></span><s=
pan
              style=3D"color: #606;" class=3D"styled-by-prettify">ConceptNa=
me{}</span><span
              style=3D"color: #000;" class=3D"styled-by-prettify"> </span><=
span
              style=3D"color: #008;" class=3D"styled-by-prettify">const</sp=
an><span
              style=3D"color: #660;" class=3D"styled-by-prettify">&amp;);</=
span></div>
        </code></div>
    </div>
    or
    <div class=3D"prettyprint" style=3D"background-color: rgb(250, 250,
      250); border-color: rgb(187, 187, 187); border-style: solid;
      border-width: 1px; word-wrap: break-word;"><code
        class=3D"prettyprint">
        <div class=3D"subprettyprint"><span style=3D"color: #008;"
            class=3D"styled-by-prettify">void</span><span style=3D"color:
            #000;" class=3D"styled-by-prettify"> algo</span><span
            style=3D"color: #660;" class=3D"styled-by-prettify">(</span><sp=
an
            style=3D"color: #008;" class=3D"styled-by-prettify"></span><spa=
n
            style=3D"color: #606;" class=3D"styled-by-prettify">ConceptName=
{auto}</span><span
            style=3D"color: #000;" class=3D"styled-by-prettify"> </span><sp=
an
            style=3D"color: #008;" class=3D"styled-by-prettify">const</span=
><span
            style=3D"color: #660;" class=3D"styled-by-prettify">&amp;);</sp=
an></div>
      </code></div>
    <br>
    The last is explicit with the current generic lambdas. Just deduce
    the type.<br>
    <br>
    I find<br>
    <div>
      <div class=3D"prettyprint" style=3D"background-color: rgb(250, 250,
        250); border-color: rgb(187, 187, 187); border-style: solid;
        border-width: 1px; word-wrap: break-word;"><code
          class=3D"prettyprint">
          <div class=3D"subprettyprint"><span style=3D"color: #008;"
              class=3D"styled-by-prettify">void</span><span style=3D"color:
              #000;" class=3D"styled-by-prettify"> algo</span><span
              style=3D"color: #660;" class=3D"styled-by-prettify">(</span><=
span
              style=3D"color: #008;" class=3D"styled-by-prettify"></span><s=
pan
              style=3D"color: #606;" class=3D"styled-by-prettify">ConceptNa=
me{}</span><span
              style=3D"color: #000;" class=3D"styled-by-prettify"> </span><=
span
              style=3D"color: #008;" class=3D"styled-by-prettify">const</sp=
an><span
              style=3D"color: #660;" class=3D"styled-by-prettify">&amp;);</=
span></div>
        </code></div>
    </div>
    has the advantage to state clearly that this is not a usual
    function.<br>
    <br>
    The absence of a type would men auto.<br>
    <br>
    <blockquote
      cite=3D"mid:88843922-dd0d-4b59-af78-d1dccbdc7a7b@isocpp.org"
      type=3D"cite">
      <div dir=3D"ltr">
        <div>Note that in this way, it's obvious that if 2 more args
          have the same Concept, they may deduce to different types,
          just as non-constrained auto.</div>
        <div>
          <div class=3D"prettyprint" style=3D"background-color: rgb(250,
            250, 250); border-color: rgb(187, 187, 187); border-style:
            solid; border-width: 1px; word-wrap: break-word;"><code
              class=3D"prettyprint">
              <div class=3D"subprettyprint"><span style=3D"color: #008;"
                  class=3D"styled-by-prettify">void</span><span
                  style=3D"color: #000;" class=3D"styled-by-prettify"> algo=
</span><span
                  style=3D"color: #660;" class=3D"styled-by-prettify">(</sp=
an><span
                  style=3D"color: #008;" class=3D"styled-by-prettify">auto<=
/span><span
                  style=3D"color: #660;" class=3D"styled-by-prettify">:</sp=
an><span
                  style=3D"color: #606;" class=3D"styled-by-prettify">Conce=
ptName</span><span
                  style=3D"color: #000;" class=3D"styled-by-prettify"> </sp=
an><span
                  style=3D"color: #008;" class=3D"styled-by-prettify">const=
</span><span
                  style=3D"color: #660;" class=3D"styled-by-prettify">&amp;=
</span><span
                  style=3D"color: #000;" class=3D"styled-by-prettify"> a</s=
pan><span
                  style=3D"color: #660;" class=3D"styled-by-prettify">,</sp=
an><span
                  style=3D"color: #000;" class=3D"styled-by-prettify"> </sp=
an><span
                  style=3D"color: #008;" class=3D"styled-by-prettify">auto<=
/span><span
                  style=3D"color: #660;" class=3D"styled-by-prettify">:</sp=
an><span
                  style=3D"color: #606;" class=3D"styled-by-prettify">Conce=
ptName</span><span
                  style=3D"color: #000;" class=3D"styled-by-prettify"> </sp=
an><span
                  style=3D"color: #008;" class=3D"styled-by-prettify">const=
</span><span
                  style=3D"color: #660;" class=3D"styled-by-prettify">&amp;=
</span><span
                  style=3D"color: #000;" class=3D"styled-by-prettify"> b</s=
pan><span
                  style=3D"color: #660;" class=3D"styled-by-prettify">);</s=
pan></div>
            </code></div>
          <span style=3D"background-color: rgb(250, 250, 250); color:
            rgb(102, 102, 0); font-family: monospace;"><br>
          </span></div>
      </div>
    </blockquote>
    Hmm, how do you say that the two parameters have the same type?<br>
    <div class=3D"prettyprint" style=3D"background-color: rgb(250, 250,
      250); border-color: rgb(187, 187, 187); border-style: solid;
      border-width: 1px; word-wrap: break-word;"><code
        class=3D"prettyprint">
        <div class=3D"subprettyprint"><span style=3D"color: #008;"
            class=3D"styled-by-prettify">void</span><span style=3D"color:
            #000;" class=3D"styled-by-prettify"> algo</span><span
            style=3D"color: #660;" class=3D"styled-by-prettify">(</span><sp=
an
            style=3D"color: #008;" class=3D"styled-by-prettify">T</span><sp=
an
            style=3D"color: #660;" class=3D"styled-by-prettify">:</span><sp=
an
            style=3D"color: #606;" class=3D"styled-by-prettify">ConceptName=
</span><span
            style=3D"color: #000;" class=3D"styled-by-prettify"> </span><sp=
an
            style=3D"color: #008;" class=3D"styled-by-prettify">const</span=
><span
            style=3D"color: #660;" class=3D"styled-by-prettify">&amp;</span=
><span
            style=3D"color: #000;" class=3D"styled-by-prettify"> a</span><s=
pan
            style=3D"color: #660;" class=3D"styled-by-prettify">,</span><sp=
an
            style=3D"color: #000;" class=3D"styled-by-prettify"> T</span><s=
pan
            style=3D"color: #000;" class=3D"styled-by-prettify"> </span><sp=
an
            style=3D"color: #008;" class=3D"styled-by-prettify">const</span=
><span
            style=3D"color: #660;" class=3D"styled-by-prettify">&amp;</span=
><span
            style=3D"color: #000;" class=3D"styled-by-prettify"> b</span><s=
pan
            style=3D"color: #660;" class=3D"styled-by-prettify">);</span></=
div>
      </code></div>
    <br>
    With my suggestion:<br>
    =C2=A0<br>
    Explicitly possibly different types <br>
    <div class=3D"prettyprint" style=3D"background-color: rgb(250, 250,
      250); border-color: rgb(187, 187, 187); border-style: solid;
      border-width: 1px; word-wrap: break-word;"><code
        class=3D"prettyprint">
        <div class=3D"subprettyprint"><span style=3D"color: #008;"
            class=3D"styled-by-prettify">void</span><span style=3D"color:
            #000;" class=3D"styled-by-prettify"> algo</span><span
            style=3D"color: #660;" class=3D"styled-by-prettify">(</span><sp=
an
            style=3D"color: #660;" class=3D"styled-by-prettify"></span><spa=
n
            style=3D"color: #606;" class=3D"styled-by-prettify">ConceptName=
</span><span
            style=3D"color: #000;" class=3D"styled-by-prettify">{T} </span>=
<span
            style=3D"color: #008;" class=3D"styled-by-prettify">const</span=
><span
            style=3D"color: #660;" class=3D"styled-by-prettify">&amp;</span=
><span
            style=3D"color: #000;" class=3D"styled-by-prettify"> a</span><s=
pan
            style=3D"color: #660;" class=3D"styled-by-prettify">,</span><sp=
an
            style=3D"color: #000;" class=3D"styled-by-prettify"> </span><sp=
an
            style=3D"color: #606;" class=3D"styled-by-prettify">ConceptName=
</span><span
            style=3D"color: #000;" class=3D"styled-by-prettify">{U} </span>=
<span
            style=3D"color: #008;" class=3D"styled-by-prettify">const</span=
><span
            style=3D"color: #660;" class=3D"styled-by-prettify">&amp;</span=
><span
            style=3D"color: #000;" class=3D"styled-by-prettify"> b</span><s=
pan
            style=3D"color: #660;" class=3D"styled-by-prettify">);</span></=
div>
      </code></div>
    <br>
    Explicitly same type <br>
    <div class=3D"prettyprint" style=3D"background-color: rgb(250, 250,
      250); border-color: rgb(187, 187, 187); border-style: solid;
      border-width: 1px; word-wrap: break-word;"><code
        class=3D"prettyprint">
        <div class=3D"subprettyprint"><span style=3D"color: #008;"
            class=3D"styled-by-prettify">void</span><span style=3D"color:
            #000;" class=3D"styled-by-prettify"> algo</span><span
            style=3D"color: #660;" class=3D"styled-by-prettify">(</span><sp=
an
            style=3D"color: #660;" class=3D"styled-by-prettify"></span><spa=
n
            style=3D"color: #606;" class=3D"styled-by-prettify">ConceptName=
</span><span
            style=3D"color: #000;" class=3D"styled-by-prettify">{T} </span>=
<span
            style=3D"color: #008;" class=3D"styled-by-prettify">const</span=
><span
            style=3D"color: #660;" class=3D"styled-by-prettify">&amp;</span=
><span
            style=3D"color: #000;" class=3D"styled-by-prettify"> a</span><s=
pan
            style=3D"color: #660;" class=3D"styled-by-prettify">,</span><sp=
an
            style=3D"color: #000;" class=3D"styled-by-prettify"> T</span><s=
pan
            style=3D"color: #000;" class=3D"styled-by-prettify"> </span><sp=
an
            style=3D"color: #008;" class=3D"styled-by-prettify">const</span=
><span
            style=3D"color: #660;" class=3D"styled-by-prettify">&amp;</span=
><span
            style=3D"color: #000;" class=3D"styled-by-prettify"> b</span><s=
pan
            style=3D"color: #660;" class=3D"styled-by-prettify">);</span></=
div>
      </code></div>
    <br>
    What could mean<br>
    <br>
    <div class=3D"prettyprint" style=3D"background-color: rgb(250, 250,
      250); border-color: rgb(187, 187, 187); border-style: solid;
      border-width: 1px; word-wrap: break-word;"><code
        class=3D"prettyprint">
        <div class=3D"subprettyprint"><span style=3D"color: #008;"
            class=3D"styled-by-prettify">void</span><span style=3D"color:
            #000;" class=3D"styled-by-prettify"> algo</span><span
            style=3D"color: #660;" class=3D"styled-by-prettify">(</span><sp=
an
            style=3D"color: #660;" class=3D"styled-by-prettify"></span><spa=
n
            style=3D"color: #606;" class=3D"styled-by-prettify">ConceptName=
</span><span
            style=3D"color: #000;" class=3D"styled-by-prettify">{} </span><=
span
            style=3D"color: #008;" class=3D"styled-by-prettify">const</span=
><span
            style=3D"color: #660;" class=3D"styled-by-prettify">&amp;</span=
><span
            style=3D"color: #000;" class=3D"styled-by-prettify"> a</span><s=
pan
            style=3D"color: #660;" class=3D"styled-by-prettify">,</span><sp=
an
            style=3D"color: #000;" class=3D"styled-by-prettify"> </span><sp=
an
            style=3D"color: #606;" class=3D"styled-by-prettify">ConceptName=
</span><span
            style=3D"color: #000;" class=3D"styled-by-prettify">{} </span><=
span
            style=3D"color: #008;" class=3D"styled-by-prettify">const</span=
><span
            style=3D"color: #660;" class=3D"styled-by-prettify">&amp;</span=
><span
            style=3D"color: #000;" class=3D"styled-by-prettify"> b</span><s=
pan
            style=3D"color: #660;" class=3D"styled-by-prettify">);</span></=
div>
      </code></div>
    or <br>
    <div class=3D"prettyprint" style=3D"background-color: rgb(250, 250,
      250); border-color: rgb(187, 187, 187); border-style: solid;
      border-width: 1px; word-wrap: break-word;"><code
        class=3D"prettyprint">
        <div class=3D"subprettyprint"><span style=3D"color: #008;"
            class=3D"styled-by-prettify">void</span><span style=3D"color:
            #000;" class=3D"styled-by-prettify"> algo</span><span
            style=3D"color: #660;" class=3D"styled-by-prettify">(</span><sp=
an
            style=3D"color: #660;" class=3D"styled-by-prettify"></span><spa=
n
            style=3D"color: #606;" class=3D"styled-by-prettify">ConceptName=
</span><span
            style=3D"color: #000;" class=3D"styled-by-prettify">{auto} </sp=
an><span
            style=3D"color: #008;" class=3D"styled-by-prettify">const</span=
><span
            style=3D"color: #660;" class=3D"styled-by-prettify">&amp;</span=
><span
            style=3D"color: #000;" class=3D"styled-by-prettify"> a</span><s=
pan
            style=3D"color: #660;" class=3D"styled-by-prettify">,</span><sp=
an
            style=3D"color: #000;" class=3D"styled-by-prettify"> </span><sp=
an
            style=3D"color: #606;" class=3D"styled-by-prettify">ConceptName=
</span><span
            style=3D"color: #000;" class=3D"styled-by-prettify">{auto} </sp=
an><span
            style=3D"color: #008;" class=3D"styled-by-prettify">const</span=
><span
            style=3D"color: #660;" class=3D"styled-by-prettify">&amp;</span=
><span
            style=3D"color: #000;" class=3D"styled-by-prettify"> b</span><s=
pan
            style=3D"color: #660;" class=3D"styled-by-prettify">);</span></=
div>
      </code></div>
    <br>
    <br>
    IMO, this should not be supported as it is not explicit enough or <br>
    possibly different types as generic lambdas semantics are possible
    different types when auto is used. <br>
    Note that stating that the types are the same is even shorter. My
    preference would be different types.<br>
    <br>
    Could we use auto as the True concept?<br>
    <br>
    <div class=3D"prettyprint" style=3D"background-color: rgb(250, 250,
      250); border-color: rgb(187, 187, 187); border-style: solid;
      border-width: 1px; word-wrap: break-word;"><code
        class=3D"prettyprint">
        <div class=3D"subprettyprint"><span style=3D"color: #008;"
            class=3D"styled-by-prettify">void</span><span style=3D"color:
            #000;" class=3D"styled-by-prettify"> algo</span><span
            style=3D"color: #660;" class=3D"styled-by-prettify">(</span>aut=
o<span
            style=3D"color: #000;" class=3D"styled-by-prettify">{T} </span>=
<span
            style=3D"color: #008;" class=3D"styled-by-prettify">const</span=
><span
            style=3D"color: #660;" class=3D"styled-by-prettify">&amp;</span=
><span
            style=3D"color: #000;" class=3D"styled-by-prettify"> a</span><s=
pan
            style=3D"color: #660;" class=3D"styled-by-prettify">);</span></=
div>
      </code></div>
    <br>
    This adds more verbosity but states clearly that this is not a usual
    function.<br>
    This could be the short-form of C++17 templates.<br>
    <br>
    <br>
    Note that with the current Concept TS the type of the parameters are
    the same :(<br>
    <div class=3D"prettyprint" style=3D"background-color: rgb(250, 250,
      250); border-color: rgb(187, 187, 187); border-style: solid;
      border-width: 1px; word-wrap: break-word;"><code
        class=3D"prettyprint">
        <div class=3D"subprettyprint"><span style=3D"color: #008;"
            class=3D"styled-by-prettify">void</span><span style=3D"color:
            #000;" class=3D"styled-by-prettify"> algo</span><span
            style=3D"color: #660;" class=3D"styled-by-prettify">(</span><sp=
an
            style=3D"color: #660;" class=3D"styled-by-prettify"></span><spa=
n
            style=3D"color: #606;" class=3D"styled-by-prettify">ConceptName=
</span><span
            style=3D"color: #000;" class=3D"styled-by-prettify"> </span><sp=
an
            style=3D"color: #008;" class=3D"styled-by-prettify">const</span=
><span
            style=3D"color: #660;" class=3D"styled-by-prettify">&amp;</span=
><span
            style=3D"color: #000;" class=3D"styled-by-prettify"> a</span><s=
pan
            style=3D"color: #660;" class=3D"styled-by-prettify">,</span><sp=
an
            style=3D"color: #000;" class=3D"styled-by-prettify"> </span><sp=
an
            style=3D"color: #606;" class=3D"styled-by-prettify">ConceptName=
</span><span
            style=3D"color: #000;" class=3D"styled-by-prettify"> </span><sp=
an
            style=3D"color: #008;" class=3D"styled-by-prettify">const</span=
><span
            style=3D"color: #660;" class=3D"styled-by-prettify">&amp;</span=
><span
            style=3D"color: #000;" class=3D"styled-by-prettify"> b</span><s=
pan
            style=3D"color: #660;" class=3D"styled-by-prettify">);</span></=
div>
      </code></div>
    <br>
    What could mean<br>
    <div class=3D"prettyprint" style=3D"background-color: rgb(250, 250,
      250); border-color: rgb(187, 187, 187); border-style: solid;
      border-width: 1px; word-wrap: break-word;"><code
        class=3D"prettyprint">
        <div class=3D"subprettyprint"><span style=3D"color: #008;"
            class=3D"styled-by-prettify">void</span><span style=3D"color:
            #000;" class=3D"styled-by-prettify"> algo</span><span
            style=3D"color: #660;" class=3D"styled-by-prettify">(</span><sp=
an
            style=3D"color: #660;" class=3D"styled-by-prettify"></span><spa=
n
            style=3D"color: #606;" class=3D"styled-by-prettify">ConceptName=
</span><span
            style=3D"color: #000;" class=3D"styled-by-prettify">{T} </span>=
<span
            style=3D"color: #008;" class=3D"styled-by-prettify">const</span=
><span
            style=3D"color: #660;" class=3D"styled-by-prettify">&amp;</span=
><span
            style=3D"color: #000;" class=3D"styled-by-prettify"> a</span><s=
pan
            style=3D"color: #660;" class=3D"styled-by-prettify">,</span><sp=
an
            style=3D"color: #000;" class=3D"styled-by-prettify"> </span><sp=
an
            style=3D"color: #606;" class=3D"styled-by-prettify">ConceptName=
</span><span
            style=3D"color: #000;" class=3D"styled-by-prettify">{} </span><=
span
            style=3D"color: #008;" class=3D"styled-by-prettify">const</span=
><span
            style=3D"color: #660;" class=3D"styled-by-prettify">&amp;</span=
><span
            style=3D"color: #000;" class=3D"styled-by-prettify"> b</span><s=
pan
            style=3D"color: #660;" class=3D"styled-by-prettify">);</span></=
div>
      </code></div>
    <br>
    IMO, this should not be supported as it is not explicit enough or <br>
    possibly different types as stating that the types are the same is
    even shorter. My preference would be here different.<br>
    <br>
    How all this extends to (generic) lambda expressions?<br>
    <br>
    <div class=3D"prettyprint" style=3D"background-color: rgb(250, 250,
      250); border-color: rgb(187, 187, 187); border-style: solid;
      border-width: 1px; word-wrap: break-word;"><code
        class=3D"prettyprint">
        <div class=3D"subprettyprint"><span style=3D"color: #008;"
            class=3D"styled-by-prettify">[]</span><span style=3D"color:
            #660;" class=3D"styled-by-prettify">(</span>C<span
            style=3D"color: #000;" class=3D"styled-by-prettify">{T} </span>=
<span
            style=3D"color: #008;" class=3D"styled-by-prettify">const</span=
><span
            style=3D"color: #660;" class=3D"styled-by-prettify">&amp;</span=
><span
            style=3D"color: #000;" class=3D"styled-by-prettify"> a</span><s=
pan
            style=3D"color: #660;" class=3D"styled-by-prettify">);</span></=
div>
      </code></div>
    <br>
    I don't see any major issue.<br>
    <code class=3D"prettyprint"><span style=3D"color: #660;"
        class=3D"styled-by-prettify">auto should the equivalent to
        auto{auto}: deduce the type without no constraints</span></code><br=
>
    <br>
    <div class=3D"prettyprint" style=3D"background-color: rgb(250, 250,
      250); border-color: rgb(187, 187, 187); border-style: solid;
      border-width: 1px; word-wrap: break-word;"><code
        class=3D"prettyprint">
        <div class=3D"subprettyprint"><span style=3D"color: #008;"
            class=3D"styled-by-prettify">[]</span><span style=3D"color:
            #660;" class=3D"styled-by-prettify">(auto</span><span
            style=3D"color: #000;" class=3D"styled-by-prettify"> </span><sp=
an
            style=3D"color: #008;" class=3D"styled-by-prettify">const</span=
><span
            style=3D"color: #660;" class=3D"styled-by-prettify">&amp;</span=
><span
            style=3D"color: #000;" class=3D"styled-by-prettify"> a</span><s=
pan
            style=3D"color: #660;" class=3D"styled-by-prettify">);</span></=
div>
      </code></div>
    <br>
    <br>
    <br>
    <blockquote
      cite=3D"mid:88843922-dd0d-4b59-af78-d1dccbdc7a7b@isocpp.org"
      type=3D"cite">
      <div dir=3D"ltr">Although it's little more verbose that the original
        ones, I think it adds great clarity to the code while still
        keeps the brevity.<br>
        <div>Has similar idea been discussed before?</div>
      </div>
    </blockquote>
    Yes.<br>
    <br>
    Vicente<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/d2d696b3-5529-d801-3930-be458ebcde8a%=
40wanadoo.fr?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/d2d696b3-5529-d801-3930-be458ebcde8a=
%40wanadoo.fr</a>.<br />

--------------7AB55D22893FEE18197695C9--

.


Author: TONGARI J <tongari95@gmail.com>
Date: Fri, 24 Feb 2017 02:17:26 -0800 (PST)
Raw View
------=_Part_394_861001458.1487931446138
Content-Type: multipart/alternative;
 boundary="----=_Part_395_1726982645.1487931446139"

------=_Part_395_1726982645.1487931446139
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On Friday, February 24, 2017 at 4:41:27 PM UTC+8, Vicente J. Botet Escriba=
=20
wrote:
>
> Le 24/02/2017 =C3=A0 07:54, TONGARI J a =C3=A9crit :
>
> A constrained template is written in this way (verbose):
> template<typename T>
>     requires ConceptName<T>
> void algo(T const&);
>
> In p0557r0, it mentions shorthand notation:
> template<ConceptName T>
> void algo(T const&);
>
> And short-form notation:
> void algo(ConceptName const&);
>
> While C++17 introduces template <auto v>, so what does template<Integer I=
>=20
> mean? should `I` be an auto-deduced template non-type arg? or should it b=
e=20
> a template type arg constrained by Integer? Either way, it's confusing.
>
> I believe it would depend on what Integer is. If Integer is a type I is a=
=20
> value, if Integer is a concept I is a type that satisfies the Integer=20
> concept. Am I missing something?
> I agree that this adds adds some syntactical confusion for the reader, as=
=20
> now we need to see what Integer is before knowing what I is.
>

In my example, Integer is a concept. My point is that with the "template <
Concept id>" syntax, you have to coin a meaning on that - either id being a=
=20
template type arg or a template non- type arg, and you happen to choose the=
=20
former, while there's no reason why one decision is better than the other -=
=20
they're just equally good and thus confusing.

My idea would allow both
template<typename:Integral T>
struct S1 {};

S1<int>{}; // ok
S1<float>{}; // error

and
template<auto:Integral V>
struct S2 {};

S2<0>{}; // ok
S2<nullptr>{}; // error

> I think we'd better separate the domains of types & values:
>
> A shorthand notation becomes:
> template<typename:ConceptName T>
> void algo(T const&);
> Note that typename & class is interchangeable here.
>
> Today the language has been using typename whenever we need to make=20
> explicit that something dependent is a type. But here T is not dependent.
>

Sorry I don't know what you mean here, the proposed "typename:ConceptName T=
"=20
is just a constrained version of the old school "typename T".

When you want an unconstrained type you use template <typename T>.
> You are suggesting in the short-form  auto::ConceptName to mean a deduced=
=20
> type satisfying ConceptName, so maybe the natural way would be <typename=
=20
> T:ConceptName>.
>

There is a reason I prefer to put ":ConceptName" right after the keyword=20
(typename/class/auto). Remember the extended typedef mentioned in this=20
thread=20
<https://groups.google.com/a/isocpp.org/d/topic/std-proposals/qq2Q2XSQ_k8/d=
iscussion>.=20
I can do:
void algo(typedef auto:Concept T const& a, t T const& b);

which is equivalent to your syntax:
void algo(Concept{T} const& a, T const& b);=20

> A short-form notation becomes:
> void algo(auto:ConceptName const&);
>
> I've suggested  (just yesterday on the reflector) a syntax that while=20
> different from yours should be equivalent. I have also thought to=20
> T:Concept, but as brace-introducers take the form Concept{T}, I believe=
=20
> that it is more coherent, but may be I'm missing something evident that=
=20
> would force to have a different syntax to help the parser.
>
> T:Concept will be better than the current situation as well.
>
> If you need a T
>
> void algo(ConceptName{T} const&);
>
> and if you don't need the T, it could be=20
>
> void algo(ConceptName{} const&);
> or=20
> void algo(ConceptName{auto} const&);
>
> The last is explicit with the current generic lambdas. Just deduce the=20
> type.
>
> I find
> void algo(ConceptName{} const&);
> has the advantage to state clearly that this is not a usual function.
>
> The absence of a type would men auto.
>

I find the ConceptName{} syntax a bit strange as it looks like brace-init=
=20
of object. That said, every new proposed syntax could look strange ;)

> Note that in this way, it's obvious that if 2 more args have the same=20
> Concept, they may deduce to different types, just as non-constrained auto=
..
> void algo(auto:ConceptName const& a, auto:ConceptName const& b);
>
> Hmm, how do you say that the two parameters have the same type?
> void algo(T:ConceptName const& a, T const& b);
>

Simple, as the onion principle that Bjarne described, you could always use=
=20
a more flexible version:
template<typename:ConceptName T>
void algo(T const& a, T const& b);
....or use the aforementioned extended typedef syntax (not proposed here).

Also note that=20
=20

> With my suggestion:
> =20
> Explicitly possibly different types=20
> void algo(ConceptName{T} const& a, ConceptName{U} const& b);
>
> Explicitly same type=20
> void algo(ConceptName{T} const& a, T const& b);
>
> What could mean
>
> void algo(ConceptName{} const& a, ConceptName{} const& b);
> or=20
> void algo(ConceptName{auto} const& a, ConceptName{auto} const& b);
>
>
> IMO, this should not be supported as it is not explicit enough or=20
> possibly different types as generic lambdas semantics are possible=20
> different types when auto is used.=20
> Note that stating that the types are the same is even shorter. My=20
> preference would be different types.
>
> Could we use auto as the True concept?
>
> void algo(auto{T} const& a);
>
> This adds more verbosity but states clearly that this is not a usual=20
> function.
> This could be the short-form of C++17 templates.
>
>
> Note that with the current Concept TS the type of the parameters are the=
=20
> same :(
> void algo(ConceptName const& a, ConceptName const& b);
>
> What could mean
> void algo(ConceptName{T} const& a, ConceptName{} const& b);
>
> IMO, this should not be supported as it is not explicit enough or=20
> possibly different types as stating that the types are the same is even=
=20
> shorter. My preference would be here different.
>
> How all this extends to (generic) lambda expressions?
>
> [](C{T} const& a);
>
> I don't see any major issue.
> auto should the equivalent to auto{auto}: deduce the type without no=20
> constraints
>
> [](auto const& a);
>

I personally have no objections to your syntax, as it's even shorter ;)
The core idea is that - the abbreviated syntax should be able to=20
distinguish the use of Concept on type or value.

--=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/d2c51be6-8038-4c8d-9d91-0765a21343ba%40isocpp.or=
g.

------=_Part_395_1726982645.1487931446139
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Friday, February 24, 2017 at 4:41:27 PM UTC+8, Vicente =
J. Botet Escriba wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0=
;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">
 =20
   =20
 =20
  <div bgcolor=3D"#FFFFFF" text=3D"#000000">
    <div>Le 24/02/2017 =C3=A0 07:54, TONGARI J a
      =C3=A9crit=C2=A0:<br>
    </div>
    <blockquote type=3D"cite">
      <div dir=3D"ltr">
        <div>A constrained template is written in this way (verbose):</div>
        <div style=3D"background-color:rgb(250,250,250);border-color:rgb(18=
7,187,187);border-style:solid;border-width:1px;word-wrap:break-word"><code>
            <div><span style=3D"color:#008">template</span><span style=3D"c=
olor:#660">&lt;</span><span style=3D"color:#008">typename</span><span style=
=3D"color:#000"> T</span><span style=3D"color:#660">&gt;</span><span style=
=3D"color:#000"><br>
                =C2=A0 =C2=A0 requires </span><span style=3D"color:#606">Co=
nceptName</span><span style=3D"color:#660">&lt;</span><span style=3D"color:=
#000">T</span><span style=3D"color:#660">&gt;</span><span style=3D"color:#0=
00"><br>
              </span><span style=3D"color:#008">void</span><span style=3D"c=
olor:#000"> algo</span><span style=3D"color:#660">(</span><span style=3D"co=
lor:#000">T </span><span style=3D"color:#008">const</span><span style=3D"co=
lor:#660">&amp;);</span></div>
          </code></div>
        <br>
        <div>
          <div>In=C2=A0p0557r0, it mentions=C2=A0shorthand=C2=A0notation:</=
div>
        </div>
        <div>
          <div style=3D"background-color:rgb(250,250,250);border-color:rgb(=
187,187,187);border-style:solid;border-width:1px;word-wrap:break-word"><cod=
e>
              <div><span style=3D"color:#008">template</span><span style=3D=
"color:#660">&lt;</span><span style=3D"color:#606">ConceptName</span><span =
style=3D"color:#000"> T</span><span style=3D"color:#660">&gt;</span><span s=
tyle=3D"color:#000"><br>
                </span><span style=3D"color:#008">void</span><span style=3D=
"color:#000"> algo</span><span style=3D"color:#660">(</span><span style=3D"=
color:#000">T </span><span style=3D"color:#008">const</span><span style=3D"=
color:#660">&amp;);</span></div>
            </code></div>
          <span style=3D"font-family:monospace;background-color:rgb(250,250=
,250);color:rgb(102,102,0)">
            <div><span style=3D"font-family:monospace;background-color:rgb(=
250,250,250);color:rgb(102,102,0)"><br>
              </span></div>
          </span>And short-form notation:</div>
        <div>
          <div style=3D"background-color:rgb(250,250,250);border-color:rgb(=
187,187,187);border-style:solid;border-width:1px;word-wrap:break-word"><cod=
e>
              <div><span style=3D"color:#008">void</span><span style=3D"col=
or:#000"> algo</span><span style=3D"color:#660">(</span><span style=3D"colo=
r:#606">ConceptName</span><span style=3D"color:#000"> </span><span style=3D=
"color:#008">const</span><span style=3D"color:#660">&amp;);</span></div>
            </code></div>
          <span style=3D"font-family:monospace;background-color:rgb(250,250=
,250);color:rgb(102,102,0)"><br>
          </span>While C++17 introduces=C2=A0<span style=3D"color:rgb(0,0,1=
36)">template</span><span style=3D"color:rgb(0,0,0)">=C2=A0</span><span sty=
le=3D"color:rgb(102,102,0)">&lt;</span><span style=3D"color:rgb(0,0,136)">a=
uto</span><span style=3D"color:rgb(0,0,0)">=C2=A0v</span><span style=3D"col=
or:rgb(102,102,0)">&gt;</span>,
          so what does=C2=A0<span style=3D"font-family:monospace;background=
-color:rgb(250,250,250);color:rgb(0,0,136)">template</span><span style=3D"f=
ont-family:monospace;background-color:rgb(250,250,250);color:rgb(102,102,0)=
">&lt;</span><span style=3D"font-family:monospace;background-color:rgb(250,=
250,250)"><font color=3D"#660066">Integer I</font></span><span style=3D"fon=
t-family:monospace;background-color:rgb(250,250,250);color:rgb(102,102,0)">=
&gt;</span> mean? should `I` be an auto-deduced
          template non-type arg? or should it be a template type arg
          constrained by Integer? Either way, it&#39;s confusing.</div>
      </div>
    </blockquote>
    I believe it would depend on what Integer is. If Integer is a type I
    is a value, if Integer is a concept I is a type that satisfies the
    Integer concept. Am I missing something?<br>
    I agree that this adds adds some syntactical confusion for the
    reader, as now we need to see what Integer is before knowing what I
    is.<br></div></blockquote><div><br></div><div>In my example,=C2=A0<span=
 style=3D"color: rgb(102, 0, 102); background-color: rgb(250, 250, 250); fo=
nt-family: monospace;">Integer=C2=A0</span>is a concept. My point is that w=
ith the &quot;<span style=3D"color: rgb(0, 0, 136);">template</span>=C2=A0<=
span style=3D"color: rgb(102, 102, 0);">&lt;</span><font color=3D"#000088">=
Concept=C2=A0</font>id<span style=3D"color: rgb(102, 102, 0);">&gt;&quot;</=
span>=C2=A0syntax, you have to coin a meaning on that - either id being a t=
emplate type arg or a template non- type arg, and you happen to choose the =
former, while there&#39;s no reason why one decision is better than the oth=
er - they&#39;re just equally good and thus confusing.</div><div><br></div>=
<div>My idea would allow both</div><div class=3D"prettyprint" style=3D"back=
ground-color: rgb(250, 250, 250); border-color: rgb(187, 187, 187); border-=
style: solid; border-width: 1px; word-wrap: break-word;"><code class=3D"pre=
ttyprint"><div class=3D"subprettyprint"><span style=3D"color: #008;" class=
=3D"styled-by-prettify">template</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">&lt;</span><span style=3D"color: #008;" class=3D"st=
yled-by-prettify">typename</span><span style=3D"color: #660;" class=3D"styl=
ed-by-prettify">:</span><span style=3D"color: #606;" class=3D"styled-by-pre=
ttify">Integral</span><span style=3D"color: #000;" class=3D"styled-by-prett=
ify"> T</span><span style=3D"color: #660;" class=3D"styled-by-prettify">&gt=
;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br></spa=
n><span style=3D"color: #008;" class=3D"styled-by-prettify">struct</span><s=
pan style=3D"color: #000;" class=3D"styled-by-prettify"> S1 </span><span st=
yle=3D"color: #660;" class=3D"styled-by-prettify">{};</span><span style=3D"=
color: #000;" class=3D"styled-by-prettify"><br><br>S1</span><span style=3D"=
color: #080;" class=3D"styled-by-prettify">&lt;int&gt;</span><span style=3D=
"color: #660;" class=3D"styled-by-prettify">{};</span><span style=3D"color:=
 #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #800;" c=
lass=3D"styled-by-prettify">// ok</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"><br>S1</span><span style=3D"color: #080;" class=3D"=
styled-by-prettify">&lt;float&gt;</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">{};</span><span style=3D"color: #000;" class=3D"sty=
led-by-prettify"> </span><span style=3D"color: #800;" class=3D"styled-by-pr=
ettify">// error</span></div></code></div><div><br></div><div><span style=
=3D"background-color: rgb(250, 250, 250);">and</span></div><div class=3D"pr=
ettyprint" style=3D"background-color: rgb(250, 250, 250); border-color: rgb=
(187, 187, 187); border-style: solid; border-width: 1px; word-wrap: break-w=
ord;"><code class=3D"prettyprint"><div class=3D"subprettyprint"><span style=
=3D"color: #008;" class=3D"styled-by-prettify">template</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">&lt;</span><span style=3D"co=
lor: #008;" class=3D"styled-by-prettify">auto</span><span style=3D"color: #=
660;" class=3D"styled-by-prettify">:</span><span style=3D"color: #606;" cla=
ss=3D"styled-by-prettify">Integral</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> V</span><span style=3D"color: #660;" class=3D"styl=
ed-by-prettify">&gt;</span><span style=3D"color: #000;" class=3D"styled-by-=
prettify"><br></span><span style=3D"color: #008;" class=3D"styled-by-pretti=
fy">struct</span><span style=3D"color: #000;" class=3D"styled-by-prettify">=
 S2 </span><span style=3D"color: #660;" class=3D"styled-by-prettify">{};</s=
pan><span style=3D"color: #000;" class=3D"styled-by-prettify"><br><br>S2</s=
pan><span style=3D"color: #660;" class=3D"styled-by-prettify">&lt;</span><s=
pan style=3D"color: #066;" class=3D"styled-by-prettify">0</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">&gt;{};</span><span style=3D=
"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #=
800;" class=3D"styled-by-prettify">// ok</span><span style=3D"color: #000;"=
 class=3D"styled-by-prettify"><br>S2</span><span style=3D"color: #080;" cla=
ss=3D"styled-by-prettify">&lt;nullptr&gt;</span><span style=3D"color: #660;=
" class=3D"styled-by-prettify">{};</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> </span><span style=3D"color: #800;" class=3D"style=
d-by-prettify">// error</span></div></code></div><blockquote class=3D"gmail=
_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;p=
adding-left: 1ex;"><div bgcolor=3D"#FFFFFF" text=3D"#000000"><blockquote ty=
pe=3D"cite"><div dir=3D"ltr">
        <div>I think we&#39;d better separate the domains of types &amp;
          values:</div>
        <div><br>
        </div>
        <div>A shorthand=C2=A0notation becomes:</div>
        <div style=3D"background-color:rgb(250,250,250);border-color:rgb(18=
7,187,187);border-style:solid;border-width:1px;word-wrap:break-word"><code>
            <div><span style=3D"color:#008">template</span><span style=3D"c=
olor:#660">&lt;</span><span style=3D"color:#008">typename</span><span style=
=3D"color:#660">:</span><span style=3D"color:#606">ConceptName</span><span =
style=3D"color:#000"> T</span><span style=3D"color:#660">&gt;</span><span s=
tyle=3D"color:#000"><br>
              </span><span style=3D"color:#008">void</span><span style=3D"c=
olor:#000"> algo</span><span style=3D"color:#660">(</span><span style=3D"co=
lor:#000">T </span><span style=3D"color:#008">const</span><span style=3D"co=
lor:#660">&amp;);</span></div>
          </code></div>
        Note that=C2=A0<span style=3D"color:rgb(0,0,136);font-family:monosp=
ace;background-color:rgb(250,250,250)">typename=C2=A0</span>&amp;=C2=A0<spa=
n style=3D"color:rgb(0,0,136)">class=C2=A0</span>is interchangeable
        here.</div>
    </blockquote>
    Today the language has been using typename whenever we need to make
    explicit that something dependent is a type. But here T is not
    dependent.<br></div></blockquote><div><br></div><div>Sorry I don&#39;t =
know what you mean here, the proposed &quot;<span style=3D"background-color=
: rgb(250, 250, 250); color: rgb(0, 0, 136);">typename</span><span style=3D=
"background-color: rgb(250, 250, 250); color: rgb(102, 102, 0);">:</span><s=
pan style=3D"background-color: rgb(250, 250, 250); color: rgb(102, 0, 102);=
">ConceptName T</span>&quot; is just a constrained version of the old schoo=
l &quot;<span style=3D"background-color: rgb(250, 250, 250); color: rgb(0, =
0, 136);">typename</span><span style=3D"background-color: rgb(250, 250, 250=
);"><font color=3D"#666600">=C2=A0T</font></span>&quot;.</div><div><br></di=
v><blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;b=
order-left: 1px #ccc solid;padding-left: 1ex;"><div bgcolor=3D"#FFFFFF" tex=
t=3D"#000000">
    When you want an unconstrained type you use template &lt;typename
    T&gt;.<br>
    You are suggesting in the short-form=C2=A0 auto::ConceptName to mean a
    deduced type satisfying ConceptName, so maybe the natural way would
    be &lt;typename T:ConceptName&gt;.</div></blockquote><div><br></div><di=
v>There is a reason I prefer to put &quot;:ConceptName&quot; right after th=
e keyword (typename/class/auto). Remember the extended typedef mentioned in=
 this=C2=A0<a href=3D"https://groups.google.com/a/isocpp.org/d/topic/std-pr=
oposals/qq2Q2XSQ_k8/discussion">thread</a>. I can do:</div><div><div class=
=3D"prettyprint" style=3D"background-color: rgb(250, 250, 250); border-colo=
r: rgb(187, 187, 187); border-style: solid; border-width: 1px; word-wrap: b=
reak-word;"><code class=3D"prettyprint"><div class=3D"subprettyprint"><span=
 style=3D"color: #008;" class=3D"styled-by-prettify">void</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> algo</span><span style=3D"c=
olor: #660;" class=3D"styled-by-prettify">(</span><span style=3D"color: #00=
8;" class=3D"styled-by-prettify">typedef</span><span style=3D"color: #000;"=
 class=3D"styled-by-prettify"> </span><span style=3D"color: #008;" class=3D=
"styled-by-prettify">auto</span><span style=3D"color: #660;" class=3D"style=
d-by-prettify">:</span><span style=3D"color: #606;" class=3D"styled-by-pret=
tify">Concept</span><span style=3D"color: #000;" class=3D"styled-by-prettif=
y"> T </span><span style=3D"color: #008;" class=3D"styled-by-prettify">cons=
t</span><span style=3D"color: #660;" class=3D"styled-by-prettify">&amp;</sp=
an><span style=3D"color: #000;" class=3D"styled-by-prettify"> a</span><span=
 style=3D"color: #660;" class=3D"styled-by-prettify">,</span><span style=3D=
"color: #000;" class=3D"styled-by-prettify"> t T </span><span style=3D"colo=
r: #008;" class=3D"styled-by-prettify">const</span><span style=3D"color: #6=
60;" class=3D"styled-by-prettify">&amp;</span><span style=3D"color: #000;" =
class=3D"styled-by-prettify"> b</span><span style=3D"color: #660;" class=3D=
"styled-by-prettify">);</span></div></code></div><br></div><div>which is eq=
uivalent to your syntax:</div><div><div class=3D"prettyprint" style=3D"back=
ground-color: rgb(250, 250, 250); border-color: rgb(187, 187, 187); border-=
style: solid; border-width: 1px; word-wrap: break-word;"><code class=3D"pre=
ttyprint"><div class=3D"subprettyprint"><span style=3D"color: #008;" class=
=3D"styled-by-prettify">void</span><span style=3D"color: #000;" class=3D"st=
yled-by-prettify"> algo</span><span style=3D"color: #660;" class=3D"styled-=
by-prettify">(</span><span style=3D"color: #606;" class=3D"styled-by-pretti=
fy">Concept</span><span style=3D"color: #660;" class=3D"styled-by-prettify"=
>{</span><span style=3D"color: #000;" class=3D"styled-by-prettify">T</span>=
<span style=3D"color: #660;" class=3D"styled-by-prettify">}</span><span sty=
le=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"col=
or: #008;" class=3D"styled-by-prettify">const</span><span style=3D"color: #=
660;" class=3D"styled-by-prettify">&amp;</span><span style=3D"color: #000;"=
 class=3D"styled-by-prettify"> a</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">,</span><span style=3D"color: #000;" class=3D"style=
d-by-prettify"> T </span><span style=3D"color: #008;" class=3D"styled-by-pr=
ettify">const</span><span style=3D"color: #660;" class=3D"styled-by-prettif=
y">&amp;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> b=
</span><span style=3D"color: #660;" class=3D"styled-by-prettify">);</span><=
span style=3D"background-color: white; font-family: Arial, Helvetica, sans-=
serif;"><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><=
/span></div></code></div></div><blockquote class=3D"gmail_quote" style=3D"m=
argin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"=
><div bgcolor=3D"#FFFFFF" text=3D"#000000"><blockquote type=3D"cite">
      <div dir=3D"ltr">
       =20
        <div>A short-form notation becomes:</div>
        <div>
          <div style=3D"background-color:rgb(250,250,250);border-color:rgb(=
187,187,187);border-style:solid;border-width:1px;word-wrap:break-word"><cod=
e>
              <div><span style=3D"color:#008">void</span><span style=3D"col=
or:#000"> algo</span><span style=3D"color:#660">(</span><span style=3D"colo=
r:#008">auto</span><span style=3D"color:#660">:</span><span style=3D"color:=
#606">ConceptName</span><span style=3D"color:#000"> </span><span style=3D"c=
olor:#008">const</span><span style=3D"color:#660">&amp;);</span></div>
            </code></div>
        </div>
        <div><br>
        </div>
      </div>
    </blockquote>
    I&#39;ve suggested=C2=A0 (just yesterday on the reflector) a syntax tha=
t
    while different from yours should be equivalent. I have also thought
    to T:Concept, but as brace-introducers take the form Concept{T}, I
    believe that it is more coherent, but may be I&#39;m missing something
    evident that would force to have a different syntax to help the
    parser.<br>
    <br>
    T:Concept will be better than the current situation as well.<br>
    <br>
    If you need a T<br>
    <br>
    <div>
      <div style=3D"background-color:rgb(250,250,250);border-color:rgb(187,=
187,187);border-style:solid;border-width:1px;word-wrap:break-word"><code>
          <div><span style=3D"color:#008">void</span><span style=3D"color:#=
000"> algo</span><span style=3D"color:#660">(</span><span style=3D"color:#0=
08"></span><span style=3D"color:#606">ConceptName{T}</span><span style=3D"c=
olor:#000"> </span><span style=3D"color:#008">const</span><span style=3D"co=
lor:#660">&amp;);</span></div>
        </code></div>
    </div>
    <br>
    and if you don&#39;t need the T, it could be <br>
    <br>
    <div>
      <div style=3D"background-color:rgb(250,250,250);border-color:rgb(187,=
187,187);border-style:solid;border-width:1px;word-wrap:break-word"><code>
          <div><span style=3D"color:#008">void</span><span style=3D"color:#=
000"> algo</span><span style=3D"color:#660">(</span><span style=3D"color:#0=
08"></span><span style=3D"color:#606">ConceptName{}</span><span style=3D"co=
lor:#000"> </span><span style=3D"color:#008">const</span><span style=3D"col=
or:#660">&amp;);</span></div>
        </code></div>
    </div>
    or
    <div style=3D"background-color:rgb(250,250,250);border-color:rgb(187,18=
7,187);border-style:solid;border-width:1px;word-wrap:break-word"><code>
        <div><span style=3D"color:#008">void</span><span style=3D"color:#00=
0"> algo</span><span style=3D"color:#660">(</span><span style=3D"color:#008=
"></span><span style=3D"color:#606">ConceptName{auto}</span><span style=3D"=
color:#000"> </span><span style=3D"color:#008">const</span><span style=3D"c=
olor:#660">&amp;);</span></div>
      </code></div>
    <br>
    The last is explicit with the current generic lambdas. Just deduce
    the type.<br>
    <br>
    I find<br>
    <div>
      <div style=3D"background-color:rgb(250,250,250);border-color:rgb(187,=
187,187);border-style:solid;border-width:1px;word-wrap:break-word"><code>
          <div><span style=3D"color:#008">void</span><span style=3D"color:#=
000"> algo</span><span style=3D"color:#660">(</span><span style=3D"color:#0=
08"></span><span style=3D"color:#606">ConceptName{}</span><span style=3D"co=
lor:#000"> </span><span style=3D"color:#008">const</span><span style=3D"col=
or:#660">&amp;);</span></div>
        </code></div>
    </div>
    has the advantage to state clearly that this is not a usual
    function.<br>
    <br>
    The absence of a type would men auto.<br></div></blockquote><div><br></=
div><div>I find the=C2=A0<span style=3D"background-color: rgb(250, 250, 250=
); color: rgb(102, 0, 102); font-family: monospace;">ConceptName{}</span>=
=C2=A0syntax a bit strange as it looks like brace-init of object. That said=
, every new proposed syntax could look strange ;)</div><blockquote class=3D=
"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc s=
olid;padding-left: 1ex;"><div bgcolor=3D"#FFFFFF" text=3D"#000000"><blockqu=
ote type=3D"cite"><div dir=3D"ltr"><div>Note that in this way, it&#39;s obv=
ious that if 2 more args
          have the same Concept, they may deduce to different types,
          just as non-constrained auto.</div>
        <div>
          <div style=3D"background-color:rgb(250,250,250);border-color:rgb(=
187,187,187);border-style:solid;border-width:1px;word-wrap:break-word"><cod=
e>
              <div><span style=3D"color:#008">void</span><span style=3D"col=
or:#000"> algo</span><span style=3D"color:#660">(</span><span style=3D"colo=
r:#008">auto</span><span style=3D"color:#660">:</span><span style=3D"color:=
#606">ConceptName</span><span style=3D"color:#000"> </span><span style=3D"c=
olor:#008">const</span><span style=3D"color:#660">&amp;</span><span style=
=3D"color:#000"> a</span><span style=3D"color:#660">,</span><span style=3D"=
color:#000"> </span><span style=3D"color:#008">auto</span><span style=3D"co=
lor:#660">:</span><span style=3D"color:#606">ConceptName</span><span style=
=3D"color:#000"> </span><span style=3D"color:#008">const</span><span style=
=3D"color:#660">&amp;</span><span style=3D"color:#000"> b</span><span style=
=3D"color:#660">);</span></div>
            </code></div>
          <span style=3D"background-color:rgb(250,250,250);color:rgb(102,10=
2,0);font-family:monospace"><br>
          </span></div>
      </div>
    </blockquote>
    Hmm, how do you say that the two parameters have the same type?<br>
    <div style=3D"background-color:rgb(250,250,250);border-color:rgb(187,18=
7,187);border-style:solid;border-width:1px;word-wrap:break-word"><code>
        <div><span style=3D"color:#008">void</span><span style=3D"color:#00=
0"> algo</span><span style=3D"color:#660">(</span><span style=3D"color:#008=
">T</span><span style=3D"color:#660">:</span><span style=3D"color:#606">Con=
ceptName</span><span style=3D"color:#000"> </span><span style=3D"color:#008=
">const</span><span style=3D"color:#660">&amp;</span><span style=3D"color:#=
000"> a</span><span style=3D"color:#660">,</span><span style=3D"color:#000"=
> T</span><span style=3D"color:#000"> </span><span style=3D"color:#008">con=
st</span><span style=3D"color:#660">&amp;</span><span style=3D"color:#000">=
 b</span><span style=3D"color:#660">);</span></div></code></div></div></blo=
ckquote><div><br></div><div>Simple, as the onion principle that Bjarne desc=
ribed, you could always use a more flexible version:</div><div class=3D"pre=
ttyprint" style=3D"background-color: rgb(250, 250, 250); border-color: rgb(=
187, 187, 187); border-style: solid; border-width: 1px; word-wrap: break-wo=
rd;"><code class=3D"prettyprint"><div class=3D"subprettyprint"><span style=
=3D"color: #008;" class=3D"styled-by-prettify">template</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">&lt;</span><span style=3D"co=
lor: #008;" class=3D"styled-by-prettify">typename</span><span style=3D"colo=
r: #660;" class=3D"styled-by-prettify">:</span><span style=3D"color: #606;"=
 class=3D"styled-by-prettify">ConceptName</span><span style=3D"color: #000;=
" class=3D"styled-by-prettify"> T</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">&gt;</span><span style=3D"color: #000;" class=3D"st=
yled-by-prettify"><br></span><span style=3D"color: #008;" class=3D"styled-b=
y-prettify">void</span><span style=3D"color: #000;" class=3D"styled-by-pret=
tify"> algo</span><span style=3D"color: #660;" class=3D"styled-by-prettify"=
>(</span><span style=3D"color: #000;" class=3D"styled-by-prettify">T </span=
><span style=3D"color: #008;" class=3D"styled-by-prettify">const</span><spa=
n style=3D"color: #660;" class=3D"styled-by-prettify">&amp;</span><span sty=
le=3D"color: #000;" class=3D"styled-by-prettify"> a</span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">,</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify"> T </span><span style=3D"color: #008;" clas=
s=3D"styled-by-prettify">const</span><span style=3D"color: #660;" class=3D"=
styled-by-prettify">&amp;</span><span style=3D"color: #000;" class=3D"style=
d-by-prettify"> b</span><span style=3D"color: #660;" class=3D"styled-by-pre=
ttify">);</span></div></code></div>...or use the aforementioned extended ty=
pedef syntax (not proposed here).<div><br></div><div>Also note that=C2=A0<b=
r><div>=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"margin: 0;mar=
gin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div bgcolo=
r=3D"#FFFFFF" text=3D"#000000">
    With my suggestion:<br>
    =C2=A0<br>
    Explicitly possibly different types <br>
    <div style=3D"background-color:rgb(250,250,250);border-color:rgb(187,18=
7,187);border-style:solid;border-width:1px;word-wrap:break-word"><code>
        <div><span style=3D"color:#008">void</span><span style=3D"color:#00=
0"> algo</span><span style=3D"color:#660">(</span><span style=3D"color:#660=
"></span><span style=3D"color:#606">ConceptName</span><span style=3D"color:=
#000">{T} </span><span style=3D"color:#008">const</span><span style=3D"colo=
r:#660">&amp;</span><span style=3D"color:#000"> a</span><span style=3D"colo=
r:#660">,</span><span style=3D"color:#000"> </span><span style=3D"color:#60=
6">ConceptName</span><span style=3D"color:#000">{U} </span><span style=3D"c=
olor:#008">const</span><span style=3D"color:#660">&amp;</span><span style=
=3D"color:#000"> b</span><span style=3D"color:#660">);</span></div>
      </code></div>
    <br>
    Explicitly same type <br>
    <div style=3D"background-color:rgb(250,250,250);border-color:rgb(187,18=
7,187);border-style:solid;border-width:1px;word-wrap:break-word"><code>
        <div><span style=3D"color:#008">void</span><span style=3D"color:#00=
0"> algo</span><span style=3D"color:#660">(</span><span style=3D"color:#660=
"></span><span style=3D"color:#606">ConceptName</span><span style=3D"color:=
#000">{T} </span><span style=3D"color:#008">const</span><span style=3D"colo=
r:#660">&amp;</span><span style=3D"color:#000"> a</span><span style=3D"colo=
r:#660">,</span><span style=3D"color:#000"> T</span><span style=3D"color:#0=
00"> </span><span style=3D"color:#008">const</span><span style=3D"color:#66=
0">&amp;</span><span style=3D"color:#000"> b</span><span style=3D"color:#66=
0">);</span></div>
      </code></div>
    <br>
    What could mean<br>
    <br>
    <div style=3D"background-color:rgb(250,250,250);border-color:rgb(187,18=
7,187);border-style:solid;border-width:1px;word-wrap:break-word"><code>
        <div><span style=3D"color:#008">void</span><span style=3D"color:#00=
0"> algo</span><span style=3D"color:#660">(</span><span style=3D"color:#660=
"></span><span style=3D"color:#606">ConceptName</span><span style=3D"color:=
#000">{} </span><span style=3D"color:#008">const</span><span style=3D"color=
:#660">&amp;</span><span style=3D"color:#000"> a</span><span style=3D"color=
:#660">,</span><span style=3D"color:#000"> </span><span style=3D"color:#606=
">ConceptName</span><span style=3D"color:#000">{} </span><span style=3D"col=
or:#008">const</span><span style=3D"color:#660">&amp;</span><span style=3D"=
color:#000"> b</span><span style=3D"color:#660">);</span></div>
      </code></div>
    or <br>
    <div style=3D"background-color:rgb(250,250,250);border-color:rgb(187,18=
7,187);border-style:solid;border-width:1px;word-wrap:break-word"><code>
        <div><span style=3D"color:#008">void</span><span style=3D"color:#00=
0"> algo</span><span style=3D"color:#660">(</span><span style=3D"color:#660=
"></span><span style=3D"color:#606">ConceptName</span><span style=3D"color:=
#000">{auto} </span><span style=3D"color:#008">const</span><span style=3D"c=
olor:#660">&amp;</span><span style=3D"color:#000"> a</span><span style=3D"c=
olor:#660">,</span><span style=3D"color:#000"> </span><span style=3D"color:=
#606">ConceptName</span><span style=3D"color:#000">{auto} </span><span styl=
e=3D"color:#008">const</span><span style=3D"color:#660">&amp;</span><span s=
tyle=3D"color:#000"> b</span><span style=3D"color:#660">);</span></div>
      </code></div>
    <br>
    <br>
    IMO, this should not be supported as it is not explicit enough or <br>
    possibly different types as generic lambdas semantics are possible
    different types when auto is used. <br>
    Note that stating that the types are the same is even shorter. My
    preference would be different types.<br>
    <br>
    Could we use auto as the True concept?<br>
    <br>
    <div style=3D"background-color:rgb(250,250,250);border-color:rgb(187,18=
7,187);border-style:solid;border-width:1px;word-wrap:break-word"><code>
        <div><span style=3D"color:#008">void</span><span style=3D"color:#00=
0"> algo</span><span style=3D"color:#660">(</span>auto<span style=3D"color:=
#000">{T} </span><span style=3D"color:#008">const</span><span style=3D"colo=
r:#660">&amp;</span><span style=3D"color:#000"> a</span><span style=3D"colo=
r:#660">);</span></div>
      </code></div>
    <br>
    This adds more verbosity but states clearly that this is not a usual
    function.<br>
    This could be the short-form of C++17 templates.<br>
    <br>
    <br>
    Note that with the current Concept TS the type of the parameters are
    the same :(<br>
    <div style=3D"background-color:rgb(250,250,250);border-color:rgb(187,18=
7,187);border-style:solid;border-width:1px;word-wrap:break-word"><code>
        <div><span style=3D"color:#008">void</span><span style=3D"color:#00=
0"> algo</span><span style=3D"color:#660">(</span><span style=3D"color:#660=
"></span><span style=3D"color:#606">ConceptName</span><span style=3D"color:=
#000"> </span><span style=3D"color:#008">const</span><span style=3D"color:#=
660">&amp;</span><span style=3D"color:#000"> a</span><span style=3D"color:#=
660">,</span><span style=3D"color:#000"> </span><span style=3D"color:#606">=
ConceptName</span><span style=3D"color:#000"> </span><span style=3D"color:#=
008">const</span><span style=3D"color:#660">&amp;</span><span style=3D"colo=
r:#000"> b</span><span style=3D"color:#660">);</span></div>
      </code></div>
    <br>
    What could mean<br>
    <div style=3D"background-color:rgb(250,250,250);border-color:rgb(187,18=
7,187);border-style:solid;border-width:1px;word-wrap:break-word"><code>
        <div><span style=3D"color:#008">void</span><span style=3D"color:#00=
0"> algo</span><span style=3D"color:#660">(</span><span style=3D"color:#660=
"></span><span style=3D"color:#606">ConceptName</span><span style=3D"color:=
#000">{T} </span><span style=3D"color:#008">const</span><span style=3D"colo=
r:#660">&amp;</span><span style=3D"color:#000"> a</span><span style=3D"colo=
r:#660">,</span><span style=3D"color:#000"> </span><span style=3D"color:#60=
6">ConceptName</span><span style=3D"color:#000">{} </span><span style=3D"co=
lor:#008">const</span><span style=3D"color:#660">&amp;</span><span style=3D=
"color:#000"> b</span><span style=3D"color:#660">);</span></div>
      </code></div>
    <br>
    IMO, this should not be supported as it is not explicit enough or <br>
    possibly different types as stating that the types are the same is
    even shorter. My preference would be here different.<br>
    <br>
    How all this extends to (generic) lambda expressions?<br>
    <br>
    <div style=3D"background-color:rgb(250,250,250);border-color:rgb(187,18=
7,187);border-style:solid;border-width:1px;word-wrap:break-word"><code>
        <div><span style=3D"color:#008">[]</span><span style=3D"color:#660"=
>(</span>C<span style=3D"color:#000">{T} </span><span style=3D"color:#008">=
const</span><span style=3D"color:#660">&amp;</span><span style=3D"color:#00=
0"> a</span><span style=3D"color:#660">);</span></div>
      </code></div>
    <br>
    I don&#39;t see any major issue.<br>
    <code><span style=3D"color:#660">auto should the equivalent to
        auto{auto}: deduce the type without no constraints</span></code><br=
>
    <br>
    <div style=3D"background-color:rgb(250,250,250);border-color:rgb(187,18=
7,187);border-style:solid;border-width:1px;word-wrap:break-word"><code>
        <div><span style=3D"color:#008">[]</span><span style=3D"color:#660"=
>(auto</span><span style=3D"color:#000"> </span><span style=3D"color:#008">=
const</span><span style=3D"color:#660">&amp;</span><span style=3D"color:#00=
0"> a</span><span style=3D"color:#660">);</span></div></code></div></div></=
blockquote><div><br></div><div>I personally have no objections to your synt=
ax, as it&#39;s even shorter ;)</div></div><div>The core idea is that - the=
 abbreviated syntax should be able to distinguish the use of Concept on typ=
e or value.</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/d2c51be6-8038-4c8d-9d91-0765a21343ba%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/d2c51be6-8038-4c8d-9d91-0765a21343ba=
%40isocpp.org</a>.<br />

------=_Part_395_1726982645.1487931446139--

------=_Part_394_861001458.1487931446138--

.


Author: TONGARI J <tongari95@gmail.com>
Date: Fri, 24 Feb 2017 02:33:31 -0800 (PST)
Raw View
------=_Part_364_1736235811.1487932411970
Content-Type: multipart/alternative;
 boundary="----=_Part_365_1826636735.1487932411971"

------=_Part_365_1826636735.1487932411971
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On Friday, February 24, 2017 at 3:24:02 PM UTC+8, Micha=C5=82 Dominiak wrot=
e:
>
> You've touched on a topic of a heated discussion on the reflectors.=20
> There's been a suggestion to use `<Concept>` instead of `Concept` when=20
> using it as a type specifier. The variant of the syntax you're proposing=
=20
> might be prettier than that, even if uglier.
>
> Though the concerns on the reflector were that it's not possible to=20
> immediately know whether `void foo(Foo &&)` can take an lvalue or not (so=
=20
> whether Foo is a concept or not), I think this post further reinforces th=
e=20
> point of view of some members of the committee that the fully abbreviated=
=20
> syntax is indeed confusing for the users (in what I count from the last=
=20
> couple of days is at least three ways).
>
> Bjarne seems to think that the fully abbreviated syntax is necessary and=
=20
> will make the language more helpful for newcomers. Based on all the posts=
=20
> on this topic that've been appearing, I don't think that is true.
>

Out of curious, where's the "reflector" discussion you mentioned? Does it=
=20
has anything to do w/ the reflection proposal?

--=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/fed728f1-9642-4bd9-a35b-8d0277db262e%40isocpp.or=
g.

------=_Part_365_1826636735.1487932411971
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Friday, February 24, 2017 at 3:24:02 PM UTC+8, Micha=C5=
=82 Dominiak wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;mar=
gin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><p dir=3D"l=
tr">You&#39;ve touched on a topic of a heated discussion on the reflectors.=
 There&#39;s been a suggestion to use `&lt;Concept&gt;` instead of `Concept=
` when using it as a type specifier. The variant of the syntax you&#39;re p=
roposing might be prettier than that, even if uglier.</p>
<p dir=3D"ltr">Though the concerns on the reflector were that it&#39;s not =
possible to immediately know whether `void foo(Foo &amp;&amp;)` can take an=
 lvalue or not (so whether Foo is a concept or not), I think this post furt=
her reinforces the point of view of some members of the committee that the =
fully abbreviated syntax is indeed confusing for the users (in what I count=
 from the last couple of days is at least three ways).</p>
<p dir=3D"ltr">Bjarne seems to think that the fully abbreviated syntax is n=
ecessary and will make the language more helpful for newcomers. Based on al=
l the posts on this topic that&#39;ve been appearing, I don&#39;t think tha=
t is true.</p></blockquote><div><br></div><div>Out of curious, where&#39;s =
the &quot;reflector&quot; discussion you mentioned? Does it has anything to=
 do w/ the reflection proposal?</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/fed728f1-9642-4bd9-a35b-8d0277db262e%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/fed728f1-9642-4bd9-a35b-8d0277db262e=
%40isocpp.org</a>.<br />

------=_Part_365_1826636735.1487932411971--

------=_Part_364_1736235811.1487932411970--

.


Author: =?UTF-8?Q?Micha=C5=82_Dominiak?= <griwes@griwes.info>
Date: Fri, 24 Feb 2017 11:20:36 +0000
Raw View
--94eb2c11c960d56ee7054944eb65
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

It means the internal mailing lists of the committee, nothing to do with
the proposal, that's just how it's referred to.

On Fri, Feb 24, 2017 at 11:33 AM TONGARI J <tongari95@gmail.com> wrote:

> On Friday, February 24, 2017 at 3:24:02 PM UTC+8, Micha=C5=82 Dominiak wr=
ote:
>
> You've touched on a topic of a heated discussion on the reflectors.
> There's been a suggestion to use `<Concept>` instead of `Concept` when
> using it as a type specifier. The variant of the syntax you're proposing
> might be prettier than that, even if uglier.
>
> Though the concerns on the reflector were that it's not possible to
> immediately know whether `void foo(Foo &&)` can take an lvalue or not (so
> whether Foo is a concept or not), I think this post further reinforces th=
e
> point of view of some members of the committee that the fully abbreviated
> syntax is indeed confusing for the users (in what I count from the last
> couple of days is at least three ways).
>
> Bjarne seems to think that the fully abbreviated syntax is necessary and
> will make the language more helpful for newcomers. Based on all the posts
> on this topic that've been appearing, I don't think that is true.
>
>
> Out of curious, where's the "reflector" discussion you mentioned? Does it
> has anything to do w/ the reflection proposal?
>
> --
> 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/fed728f1-964=
2-4bd9-a35b-8d0277db262e%40isocpp.org
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/fed728f1-96=
42-4bd9-a35b-8d0277db262e%40isocpp.org?utm_medium=3Demail&utm_source=3Dfoot=
er>
> .
>

--=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/CAPCFJdTh5h52UYwyuzCK1ireDwsPG0DwjNJx4YJ_crEjqGA=
tGQ%40mail.gmail.com.

--94eb2c11c960d56ee7054944eb65
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">It means the internal mailing lists of the committee, noth=
ing to do with the proposal, that&#39;s just how it&#39;s referred to.</div=
><br><div class=3D"gmail_quote"><div dir=3D"ltr">On Fri, Feb 24, 2017 at 11=
:33 AM TONGARI J &lt;<a href=3D"mailto:tongari95@gmail.com">tongari95@gmail=
..com</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"mar=
gin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr=
" class=3D"gmail_msg">On Friday, February 24, 2017 at 3:24:02 PM UTC+8, Mic=
ha=C5=82 Dominiak wrote:<blockquote class=3D"gmail_quote gmail_msg" style=
=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"=
><p dir=3D"ltr" class=3D"gmail_msg">You&#39;ve touched on a topic of a heat=
ed discussion on the reflectors. There&#39;s been a suggestion to use `&lt;=
Concept&gt;` instead of `Concept` when using it as a type specifier. The va=
riant of the syntax you&#39;re proposing might be prettier than that, even =
if uglier.</p>
<p dir=3D"ltr" class=3D"gmail_msg">Though the concerns on the reflector wer=
e that it&#39;s not possible to immediately know whether `void foo(Foo &amp=
;&amp;)` can take an lvalue or not (so whether Foo is a concept or not), I =
think this post further reinforces the point of view of some members of the=
 committee that the fully abbreviated syntax is indeed confusing for the us=
ers (in what I count from the last couple of days is at least three ways).<=
/p>
<p dir=3D"ltr" class=3D"gmail_msg">Bjarne seems to think that the fully abb=
reviated syntax is necessary and will make the language more helpful for ne=
wcomers. Based on all the posts on this topic that&#39;ve been appearing, I=
 don&#39;t think that is true.</p></blockquote><div class=3D"gmail_msg"><br=
 class=3D"gmail_msg"></div></div><div dir=3D"ltr" class=3D"gmail_msg"><div =
class=3D"gmail_msg">Out of curious, where&#39;s the &quot;reflector&quot; d=
iscussion you mentioned? Does it has anything to do w/ the reflection propo=
sal?</div></div>

<p class=3D"gmail_msg"></p>

-- <br class=3D"gmail_msg">
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br class=3D"gmail_msg=
">
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" class=3D"gm=
ail_msg" target=3D"_blank">std-proposals+unsubscribe@isocpp.org</a>.<br cla=
ss=3D"gmail_msg">
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" class=3D"gmail_msg" target=3D"_blank">std-proposals@isocpp.org</a>.<b=
r class=3D"gmail_msg">
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/fed728f1-9642-4bd9-a35b-8d0277db262e%=
40isocpp.org?utm_medium=3Demail&amp;utm_source=3Dfooter" class=3D"gmail_msg=
" target=3D"_blank">https://groups.google.com/a/isocpp.org/d/msgid/std-prop=
osals/fed728f1-9642-4bd9-a35b-8d0277db262e%40isocpp.org</a>.<br class=3D"gm=
ail_msg">
</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/CAPCFJdTh5h52UYwyuzCK1ireDwsPG0DwjNJx=
4YJ_crEjqGAtGQ%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">htt=
ps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAPCFJdTh5h52UYwy=
uzCK1ireDwsPG0DwjNJx4YJ_crEjqGAtGQ%40mail.gmail.com</a>.<br />

--94eb2c11c960d56ee7054944eb65--

.