Topic: Make aliased templates first class citizens


Author: adrian.hawryluk@gmail.com
Date: Sun, 17 Dec 2017 16:21:12 -0800 (PST)
Raw View
------=_Part_15117_1155179396.1513556472507
Content-Type: multipart/alternative;
 boundary="----=_Part_15118_1731546777.1513556472508"

------=_Part_15118_1731546777.1513556472508
Content-Type: text/plain; charset="UTF-8"

Templates are wonderful idea, but if I need to make a template with
partially defined parameters, this becomes problematic, requireing that an
intermediate class is made with a template in it.  Because the template
then becomes a dependent type, we then have to declare the word template
before it's name if you pass it, which is ugly and sometimes difficult to
track down what is wrong when you get the syntax incorrect.

Complete template aliasing is available in the language like this:

 template <typename FROM, typename TO>
 using my_is_convertable = std::is_convertable<FROM, TO>;

I propose that partial template aliasing also be allowed, which would allow
the template be broken up in to 2 or more sub-templates.

For example, say I have a find meta-algorithm, which will have a value that
is true if any of OP<Ts>::value... are true or false otherwise.  I will
only declare it here for brevity.

 template <typename <typename> class OP, typename...Ts>
 struct find;

It is defined as a unary template operator to apply the DRY principal.  Now
if I want to use this on a binary template operator, then I would need to
bind the parameter.  If known ahead of time, it would become:

 template <typename TO>
 using my_is_convertable = std::is_convertable<int, TO>;

and would be used like so:

 find<my_is_convertable, float, int, double>::value

However, if it's not known ahead of time what to bind the parameter to I
would have to use an class template with a embded template alias in it like
this:

 template <typename FROM>
 struct my_is_convertable
 {
   template <typename TO>
   using ttype = std::is_convertable<FROM, TO>;
 };

And use it like this:

 find<my_is_convertable<int>::template ttype, float, int double>::value

I propose that instead we use this syntax to define partial template
aliasing:

 template <typename TO>
 template <typename FROM>
 using is_convertable = std::is_convertable<TO, FROM>;

 find<my_is_convertable<int>, float, int double>::value

This would also make this valid:

 my_is_convertable<int><int>::value

Which should be fine.

Pros:

Verbosity is lowered, no more need for referring to an embedded template is
required which follows that the need for the template keyword is also
removed, all of which reducing noise.  Also it would not break anything in
the wild.  This would also mostly remove the need for tbind, except in
cases where symbol leakage is not wanted in the enclosing scope.

Cons:

Developers would need to get used to the syntax.  Nothing too crazy
though.

What is everyone's opinion on this?

--
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/8e4dd67b-e929-4f83-8f68-4a7ebd20a4e3%40isocpp.org.

------=_Part_15118_1731546777.1513556472508
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Templates are wonderful idea, but if I need to make a=
 template with partially defined parameters, this becomes problematic, requ=
ireing that an intermediate class is made with a template in it.=C2=A0 Beca=
use the template then becomes a dependent type, we then have to declare the=
 word template before it&#39;s name if you pass it, which is ugly and somet=
imes difficult to track down what is wrong when you get the syntax incorrec=
t.</div><div><br></div><div>Complete template aliasing is available in the =
language like this:</div><div><br></div><div class=3D"prettyprint" style=3D=
"background-color: rgb(250, 250, 250); border-color: rgb(187, 187, 187); bo=
rder-style: solid; border-width: 1px; word-wrap: break-word;"><code class=
=3D"prettyprint"><div class=3D"subprettyprint"><span style=3D"color: #000;"=
 class=3D"styled-by-prettify">=C2=A0</span><span style=3D"color: #008;" cla=
ss=3D"styled-by-prettify">template</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> </span><span style=3D"color: #660;" class=3D"style=
d-by-prettify">&lt;</span><span style=3D"color: #008;" class=3D"styled-by-p=
rettify">typename</span><span style=3D"color: #000;" class=3D"styled-by-pre=
ttify"> FROM</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: #008;" class=3D"styled-by-prettify">typename</span><=
span style=3D"color: #000;" class=3D"styled-by-prettify"> TO</span><span st=
yle=3D"color: #660;" class=3D"styled-by-prettify">&gt;</span><span style=3D=
"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0</span><span style=3D=
"color: #008;" class=3D"styled-by-prettify">using</span><span style=3D"colo=
r: #000;" class=3D"styled-by-prettify"> my_is_convertable </span><span styl=
e=3D"color: #660;" class=3D"styled-by-prettify">=3D</span><span style=3D"co=
lor: #000;" class=3D"styled-by-prettify"> std</span><span style=3D"color: #=
660;" class=3D"styled-by-prettify">::</span><span style=3D"color: #000;" cl=
ass=3D"styled-by-prettify">is_convertable</span><span style=3D"color: #660;=
" class=3D"styled-by-prettify">&lt;</span><span style=3D"color: #000;" clas=
s=3D"styled-by-prettify">FROM</span><span style=3D"color: #660;" class=3D"s=
tyled-by-prettify">,</span><span style=3D"color: #000;" class=3D"styled-by-=
prettify"> TO</span><span style=3D"color: #660;" class=3D"styled-by-prettif=
y">&gt;;</span></div></code></div><div><br></div><div>I propose that partia=
l template aliasing also be allowed, which would allow the template be brok=
en up in to 2 or more sub-templates.</div><div><br></div><div>For example, =
say I have a find meta-algorithm, which will have a <font face=3D"courier n=
ew, monospace">value</font> that is true if any of <font face=3D"courier ne=
w, monospace">OP&lt;Ts&gt;::value...</font> are true or false otherwise.=C2=
=A0 I will only declare it here for brevity.</div><div><br></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: #000;" class=3D"styled-by-prettify">=C2=A0</span><span sty=
le=3D"color: #008;" class=3D"styled-by-prettify">template</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color=
: #660;" class=3D"styled-by-prettify">&lt;</span><span style=3D"color: #008=
;" class=3D"styled-by-prettify">typename</span><span style=3D"color: #000;"=
 class=3D"styled-by-prettify"> </span><span style=3D"color: #080;" class=3D=
"styled-by-prettify">&lt;typename&gt;</span><span style=3D"color: #000;" cl=
ass=3D"styled-by-prettify"> </span><span style=3D"color: #008;" class=3D"st=
yled-by-prettify">class</span><span style=3D"color: #000;" class=3D"styled-=
by-prettify"> OP</span><span style=3D"color: #660;" class=3D"styled-by-pret=
tify">,</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </=
span><span style=3D"color: #008;" class=3D"styled-by-prettify">typename</sp=
an><span style=3D"color: #660;" class=3D"styled-by-prettify">...</span><spa=
n style=3D"color: #606;" class=3D"styled-by-prettify">Ts</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">&gt;</span><span style=3D"co=
lor: #000;" class=3D"styled-by-prettify"><br>=C2=A0</span><span style=3D"co=
lor: #008;" class=3D"styled-by-prettify">struct</span><span style=3D"color:=
 #000;" class=3D"styled-by-prettify"> find</span><span style=3D"color: #660=
;" class=3D"styled-by-prettify">;</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"><br></span></div></code></div><div><br></div><div>I=
t is defined as a unary template operator to apply the DRY principal.=C2=A0=
 Now if I want to use this on a binary template operator, then I would need=
 to bind the parameter.=C2=A0 If known ahead of time, it would become:</div=
><div><br></div><div class=3D"prettyprint" style=3D"background-color: rgb(2=
50, 250, 250); border-color: rgb(187, 187, 187); border-style: solid; borde=
r-width: 1px; word-wrap: break-word;"><code class=3D"prettyprint"><div clas=
s=3D"subprettyprint"><span style=3D"color: #000;" class=3D"styled-by-pretti=
fy">=C2=A0</span><span style=3D"color: #008;" class=3D"styled-by-prettify">=
template</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> <=
/span><span style=3D"color: #660;" class=3D"styled-by-prettify">&lt;</span>=
<span style=3D"color: #008;" class=3D"styled-by-prettify">typename</span><s=
pan style=3D"color: #000;" class=3D"styled-by-prettify"> TO</span><span sty=
le=3D"color: #660;" class=3D"styled-by-prettify">&gt;</span><span style=3D"=
color: #000;" class=3D"styled-by-prettify"><br>=C2=A0</span><span style=3D"=
color: #008;" class=3D"styled-by-prettify">using</span><span style=3D"color=
: #000;" class=3D"styled-by-prettify"> my_is_convertable </span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">=3D</span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify"> std</span><span style=3D"color: #6=
60;" class=3D"styled-by-prettify">::</span><span style=3D"color: #000;" cla=
ss=3D"styled-by-prettify">is_convertable</span><span style=3D"color: #660;"=
 class=3D"styled-by-prettify">&lt;</span><span style=3D"color: #008;" class=
=3D"styled-by-prettify">int</span><span style=3D"color: #660;" class=3D"sty=
led-by-prettify">,</span><span style=3D"color: #000;" class=3D"styled-by-pr=
ettify"> TO</span><span style=3D"color: #660;" class=3D"styled-by-prettify"=
>&gt;;</span></div></code></div><div><br></div><div>and would be used like =
so:</div><div><br></div><div class=3D"prettyprint" style=3D"background-colo=
r: rgb(250, 250, 250); border-color: rgb(187, 187, 187); border-style: soli=
d; border-width: 1px; word-wrap: break-word;"><code class=3D"prettyprint"><=
div class=3D"subprettyprint"><span style=3D"color: #000;" class=3D"styled-b=
y-prettify">=C2=A0find</span><span style=3D"color: #660;" class=3D"styled-b=
y-prettify">&lt;</span><span style=3D"color: #000;" class=3D"styled-by-pret=
tify">my_is_convertable</span><span style=3D"color: #660;" class=3D"styled-=
by-prettify">,</span><span style=3D"color: #000;" class=3D"styled-by-pretti=
fy"> </span><span style=3D"color: #008;" class=3D"styled-by-prettify">float=
</span><span style=3D"color: #660;" class=3D"styled-by-prettify">,</span><s=
pan style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=
=3D"color: #008;" class=3D"styled-by-prettify">int</span><span style=3D"col=
or: #660;" class=3D"styled-by-prettify">,</span><span style=3D"color: #000;=
" class=3D"styled-by-prettify"> </span><span style=3D"color: #008;" class=
=3D"styled-by-prettify">double</span><span style=3D"color: #660;" class=3D"=
styled-by-prettify">&gt;::</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify">value<br></span></div></code></div><div><br></div><div>Howe=
ver, if it&#39;s not known ahead of time what to bind the parameter to I wo=
uld have to use an class template with a embded template alias in it like t=
his:</div><div><br></div><div class=3D"prettyprint" style=3D"background-col=
or: rgb(250, 250, 250); border-color: rgb(187, 187, 187); border-style: sol=
id; border-width: 1px; word-wrap: break-word;"><code class=3D"prettyprint">=
<div class=3D"subprettyprint"><span style=3D"color: #000;" class=3D"styled-=
by-prettify">=C2=A0</span><span style=3D"color: #008;" class=3D"styled-by-p=
rettify">template</span><span style=3D"color: #000;" class=3D"styled-by-pre=
ttify"> </span><span style=3D"color: #660;" class=3D"styled-by-prettify">&l=
t;</span><span style=3D"color: #008;" class=3D"styled-by-prettify">typename=
</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> FROM</spa=
n><span style=3D"color: #660;" class=3D"styled-by-prettify">&gt;</span><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0</span><spa=
n style=3D"color: #008;" class=3D"styled-by-prettify">struct</span><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify"> my_is_convertable<br>=C2=
=A0</span><span style=3D"color: #660;" class=3D"styled-by-prettify">{</span=
><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=
=A0</span><span style=3D"color: #008;" class=3D"styled-by-prettify">templat=
e</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><=
span style=3D"color: #660;" class=3D"styled-by-prettify">&lt;</span><span s=
tyle=3D"color: #008;" class=3D"styled-by-prettify">typename</span><span sty=
le=3D"color: #000;" class=3D"styled-by-prettify"> TO</span><span style=3D"c=
olor: #660;" class=3D"styled-by-prettify">&gt;</span><span style=3D"color: =
#000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0</span><span style=3D"=
color: #008;" class=3D"styled-by-prettify">using</span><span style=3D"color=
: #000;" class=3D"styled-by-prettify"> ttype </span><span style=3D"color: #=
660;" class=3D"styled-by-prettify">=3D</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify"> std</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">::</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify">is_convertable</span><span style=3D"color: #660;" class=3D"=
styled-by-prettify">&lt;</span><span style=3D"color: #000;" class=3D"styled=
-by-prettify">FROM</span><span style=3D"color: #660;" class=3D"styled-by-pr=
ettify">,</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> =
TO</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>=C2=A0</s=
pan><span style=3D"color: #660;" class=3D"styled-by-prettify">};</span><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify"><br></span></div></co=
de></div><div><br>And use it like this:</div><div><br></div> <div class=3D"=
prettyprint" style=3D"background-color: rgb(250, 250, 250); border-color: r=
gb(187, 187, 187); border-style: solid; border-width: 1px; word-wrap: break=
-word;"><code class=3D"prettyprint"><div class=3D"subprettyprint"><span sty=
le=3D"color: #000;" class=3D"styled-by-prettify">=C2=A0find</span><span sty=
le=3D"color: #660;" class=3D"styled-by-prettify">&lt;</span><span style=3D"=
color: #000;" class=3D"styled-by-prettify">my_is_convertable</span><span st=
yle=3D"color: #080;" class=3D"styled-by-prettify">&lt;int&gt;</span><span s=
tyle=3D"color: #660;" class=3D"styled-by-prettify">::</span><span style=3D"=
color: #008;" class=3D"styled-by-prettify">template</span><span style=3D"co=
lor: #000;" class=3D"styled-by-prettify"> ttype</span><span style=3D"color:=
 #660;" class=3D"styled-by-prettify">,</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify"> </span><span style=3D"color: #008;" class=3D"s=
tyled-by-prettify">float</span><span style=3D"color: #660;" class=3D"styled=
-by-prettify">,</span><span style=3D"color: #000;" class=3D"styled-by-prett=
ify"> </span><span style=3D"color: #008;" class=3D"styled-by-prettify">int<=
/span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><sp=
an style=3D"color: #008;" class=3D"styled-by-prettify">double</span><span s=
tyle=3D"color: #660;" class=3D"styled-by-prettify">&gt;::</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify">value<br></span></div></code=
></div><div><br>I propose that instead we use this syntax to define partial=
 template aliasing:</div><div><br></div><div class=3D"prettyprint" style=3D=
"background-color: rgb(250, 250, 250); border-color: rgb(187, 187, 187); bo=
rder-style: solid; border-width: 1px; word-wrap: break-word;"><code class=
=3D"prettyprint"><div class=3D"subprettyprint"><span style=3D"color: #000;"=
 class=3D"styled-by-prettify">=C2=A0</span><span style=3D"color: #008;" cla=
ss=3D"styled-by-prettify">template</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> </span><span style=3D"color: #660;" class=3D"style=
d-by-prettify">&lt;</span><span style=3D"color: #008;" class=3D"styled-by-p=
rettify">typename</span><span style=3D"color: #000;" class=3D"styled-by-pre=
ttify"> TO</span><span style=3D"color: #660;" class=3D"styled-by-prettify">=
&gt;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=
=C2=A0</span><span style=3D"color: #008;" class=3D"styled-by-prettify">temp=
late</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </spa=
n><span style=3D"color: #660;" class=3D"styled-by-prettify">&lt;</span><spa=
n style=3D"color: #008;" class=3D"styled-by-prettify">typename</span><span =
style=3D"color: #000;" class=3D"styled-by-prettify"> FROM</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">&gt;</span><span style=3D"co=
lor: #000;" class=3D"styled-by-prettify"><br>=C2=A0</span><span style=3D"co=
lor: #008;" class=3D"styled-by-prettify">using</span><span style=3D"color: =
#000;" class=3D"styled-by-prettify"> is_convertable </span><span style=3D"c=
olor: #660;" class=3D"styled-by-prettify">=3D</span><span style=3D"color: #=
000;" class=3D"styled-by-prettify"> std</span><span style=3D"color: #660;" =
class=3D"styled-by-prettify">::</span><span style=3D"color: #000;" class=3D=
"styled-by-prettify">is_convertable</span><span style=3D"color: #660;" clas=
s=3D"styled-by-prettify">&lt;</span><span style=3D"color: #000;" class=3D"s=
tyled-by-prettify">TO</span><span style=3D"color: #660;" class=3D"styled-by=
-prettify">,</span><span style=3D"color: #000;" class=3D"styled-by-prettify=
"> FROM</span><span style=3D"color: #660;" class=3D"styled-by-prettify">&gt=
;;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br><br>=
=C2=A0find</span><span style=3D"color: #660;" class=3D"styled-by-prettify">=
&lt;</span><span style=3D"color: #000;" class=3D"styled-by-prettify">my_is_=
convertable</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: #008;" class=3D"styled-by-prettify">float</span><spa=
n 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=
: #008;" class=3D"styled-by-prettify">int</span><span style=3D"color: #000;=
" class=3D"styled-by-prettify"> </span><span style=3D"color: #008;" class=
=3D"styled-by-prettify">double</span><span style=3D"color: #660;" class=3D"=
styled-by-prettify">&gt;::</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify">value</span></div></code></div><div><br></div><div>This wou=
ld also make this valid:</div><div><br></div><div class=3D"prettyprint" sty=
le=3D"background-color: rgb(250, 250, 250); border-color: rgb(187, 187, 187=
); border-style: solid; border-width: 1px; word-wrap: break-word;"><code cl=
ass=3D"prettyprint"><div class=3D"subprettyprint"><span style=3D"color: #00=
0;" class=3D"styled-by-prettify">=C2=A0my_is_convertable</span><span style=
=3D"color: #080;" class=3D"styled-by-prettify">&lt;int&gt;&lt;int&gt;</span=
><span style=3D"color: #660;" class=3D"styled-by-prettify">::</span><span s=
tyle=3D"color: #000;" class=3D"styled-by-prettify">value<br></span></div></=
code></div><div><br></div><div>Which should be fine.</div><div><br></div><d=
iv>Pros:</div><div><br></div><div>Verbosity is lowered, no more need for re=
ferring to an embedded template is required which follows that the need for=
 the template keyword is also removed, all of which reducing noise.=C2=A0 A=
lso it would not break anything in the wild.=C2=A0 This would also mostly r=
emove the need for <font face=3D"courier new, monospace">tbind</font>, exce=
pt in cases where symbol leakage is not wanted in the enclosing scope.=C2=
=A0=C2=A0</div><div><br></div><div>Cons:</div><div><br></div><div>Developer=
s would need to get used to the syntax.=C2=A0 Nothing too crazy though.=C2=
=A0=C2=A0</div><div><br></div><div>What is everyone&#39;s opinion on this?<=
/div><div><br></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/8e4dd67b-e929-4f83-8f68-4a7ebd20a4e3%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/8e4dd67b-e929-4f83-8f68-4a7ebd20a4e3=
%40isocpp.org</a>.<br />

------=_Part_15118_1731546777.1513556472508--

------=_Part_15117_1155179396.1513556472507--

.


Author: inkwizytoryankes@gmail.com
Date: Sun, 17 Dec 2017 17:18:29 -0800 (PST)
Raw View
------=_Part_5969_1092391641.1513559909252
Content-Type: multipart/alternative;
 boundary="----=_Part_5970_2088822440.1513559909253"

------=_Part_5970_2088822440.1513559909253
Content-Type: text/plain; charset="UTF-8"



On Monday, December 18, 2017 at 1:21:12 AM UTC+1, adrian....@gmail.com
wrote:
>
> Templates are wonderful idea, but if I need to make a template with
> partially defined parameters, this becomes problematic, requireing that an
> intermediate class is made with a template in it.  Because the template
> then becomes a dependent type, we then have to declare the word template
> before it's name if you pass it, which is ugly and sometimes difficult to
> track down what is wrong when you get the syntax incorrect.
>
> Complete template aliasing is available in the language like this:
>
>  template <typename FROM, typename TO>
>  using my_is_convertable = std::is_convertable<FROM, TO>;
>
> I propose that partial template aliasing also be allowed, which would
> allow the template be broken up in to 2 or more sub-templates.
>
> For example, say I have a find meta-algorithm, which will have a value
> that is true if any of OP<Ts>::value... are true or false otherwise.  I
> will only declare it here for brevity.
>
>  template <typename <typename> class OP, typename...Ts>
>  struct find;
>
> It is defined as a unary template operator to apply the DRY principal.
> Now if I want to use this on a binary template operator, then I would need
> to bind the parameter.  If known ahead of time, it would become:
>
>  template <typename TO>
>  using my_is_convertable = std::is_convertable<int, TO>;
>
> and would be used like so:
>
>  find<my_is_convertable, float, int, double>::value
>
> However, if it's not known ahead of time what to bind the parameter to I
> would have to use an class template with a embded template alias in it like
> this:
>
>  template <typename FROM>
>  struct my_is_convertable
>  {
>    template <typename TO>
>    using ttype = std::is_convertable<FROM, TO>;
>  };
>
> And use it like this:
>
>  find<my_is_convertable<int>::template ttype, float, int double>::value
>
> I propose that instead we use this syntax to define partial template
> aliasing:
>
>  template <typename TO>
>  template <typename FROM>
>  using is_convertable = std::is_convertable<TO, FROM>;
>
>  find<my_is_convertable<int>, float, int double>::value
>
> This would also make this valid:
>
>  my_is_convertable<int><int>::value
>
> Which should be fine.
>
> Pros:
>
> Verbosity is lowered, no more need for referring to an embedded template
> is required which follows that the need for the template keyword is also
> removed, all of which reducing noise.  Also it would not break anything in
> the wild.  This would also mostly remove the need for tbind, except in
> cases where symbol leakage is not wanted in the enclosing scope.
>
> Cons:
>
> Developers would need to get used to the syntax.  Nothing too crazy
> though.
>
> What is everyone's opinion on this?
>
>
Right now I see only one problem with this:
template<typename A>
using B = typename A::template template temp<1><2>;
//or
template<typename A>
using C = template A::template temp<1>; //this return template not type,
this could be problematic when C++20 remove options for different `using`
//or
template<typename A>
using D = template template A::temp;
You will probably need something like this to allow proper handle of `<`
and `>` by compiler in dependent context.

--
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/7eb526d4-c557-443c-a7d5-235dc8e44926%40isocpp.org.

------=_Part_5970_2088822440.1513559909253
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>On Monday, December 18, 2017 at 1:21:12 AM UTC+1, =
adrian....@gmail.com wrote:<blockquote class=3D"gmail_quote" style=3D"margi=
n: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><di=
v dir=3D"ltr"><div>Templates are wonderful idea, but if I need to make a te=
mplate with partially defined parameters, this becomes problematic, require=
ing that an intermediate class is made with a template in it.=C2=A0 Because=
 the template then becomes a dependent type, we then have to declare the wo=
rd template before it&#39;s name if you pass it, which is ugly and sometime=
s difficult to track down what is wrong when you get the syntax incorrect.<=
/div><div><br></div><div>Complete template aliasing is available in the lan=
guage like this:</div><div><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:#000">=C2=A0</span><=
span style=3D"color:#008">template</span><span style=3D"color:#000"> </span=
><span style=3D"color:#660">&lt;</span><span style=3D"color:#008">typename<=
/span><span style=3D"color:#000"> FROM</span><span style=3D"color:#660">,</=
span><span style=3D"color:#000"> </span><span style=3D"color:#008">typename=
</span><span style=3D"color:#000"> TO</span><span style=3D"color:#660">&gt;=
</span><span style=3D"color:#000"><br>=C2=A0</span><span style=3D"color:#00=
8">using</span><span style=3D"color:#000"> my_is_convertable </span><span s=
tyle=3D"color:#660">=3D</span><span style=3D"color:#000"> std</span><span s=
tyle=3D"color:#660">::</span><span style=3D"color:#000">is_convertable</spa=
n><span style=3D"color:#660">&lt;</span><span style=3D"color:#000">FROM</sp=
an><span style=3D"color:#660">,</span><span style=3D"color:#000"> TO</span>=
<span style=3D"color:#660">&gt;;</span></div></code></div><div><br></div><d=
iv>I propose that partial template aliasing also be allowed, which would al=
low the template be broken up in to 2 or more sub-templates.</div><div><br>=
</div><div>For example, say I have a find meta-algorithm, which will have a=
 <font face=3D"courier new, monospace">value</font> that is true if any of =
<font face=3D"courier new, monospace">OP&lt;Ts&gt;::value...</font> are tru=
e or false otherwise.=C2=A0 I will only declare it here for brevity.</div><=
div><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:#000">=C2=A0</span><span style=3D"color:#00=
8">template</span><span style=3D"color:#000"> </span><span style=3D"color:#=
660">&lt;</span><span style=3D"color:#008">typename</span><span style=3D"co=
lor:#000"> </span><span style=3D"color:#080">&lt;typename&gt;</span><span s=
tyle=3D"color:#000"> </span><span style=3D"color:#008">class</span><span st=
yle=3D"color:#000"> OP</span><span style=3D"color:#660">,</span><span style=
=3D"color:#000"> </span><span style=3D"color:#008">typename</span><span sty=
le=3D"color:#660">...</span><span style=3D"color:#606">Ts</span><span style=
=3D"color:#660">&gt;</span><span style=3D"color:#000"><br>=C2=A0</span><spa=
n style=3D"color:#008">struct</span><span style=3D"color:#000"> find</span>=
<span style=3D"color:#660">;</span><span style=3D"color:#000"><br></span></=
div></code></div><div><br></div><div>It is defined as a unary template oper=
ator to apply the DRY principal.=C2=A0 Now if I want to use this on a binar=
y template operator, then I would need to bind the parameter.=C2=A0 If know=
n ahead of time, it would become:</div><div><br></div><div style=3D"backgro=
und-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:#00=
0">=C2=A0</span><span style=3D"color:#008">template</span><span style=3D"co=
lor:#000"> </span><span style=3D"color:#660">&lt;</span><span style=3D"colo=
r:#008">typename</span><span style=3D"color:#000"> TO</span><span style=3D"=
color:#660">&gt;</span><span style=3D"color:#000"><br>=C2=A0</span><span st=
yle=3D"color:#008">using</span><span style=3D"color:#000"> my_is_convertabl=
e </span><span style=3D"color:#660">=3D</span><span style=3D"color:#000"> s=
td</span><span style=3D"color:#660">::</span><span style=3D"color:#000">is_=
convertable</span><span style=3D"color:#660">&lt;</span><span style=3D"colo=
r:#008">int</span><span style=3D"color:#660">,</span><span style=3D"color:#=
000"> TO</span><span style=3D"color:#660">&gt;;</span></div></code></div><d=
iv><br></div><div>and would be used like so:</div><div><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:#000">=C2=A0find</span><span style=3D"color:#660">&lt;</span><spa=
n style=3D"color:#000">my_is_convertable</span><span style=3D"color:#660">,=
</span><span style=3D"color:#000"> </span><span style=3D"color:#008">float<=
/span><span style=3D"color:#660">,</span><span style=3D"color:#000"> </span=
><span style=3D"color:#008">int</span><span style=3D"color:#660">,</span><s=
pan style=3D"color:#000"> </span><span style=3D"color:#008">double</span><s=
pan style=3D"color:#660">&gt;::</span><span style=3D"color:#000">value<br><=
/span></div></code></div><div><br></div><div>However, if it&#39;s not known=
 ahead of time what to bind the parameter to I would have to use an class t=
emplate with a embded template alias in it like this:</div><div><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><spa=
n style=3D"color:#000">=C2=A0</span><span style=3D"color:#008">template</sp=
an><span style=3D"color:#000"> </span><span style=3D"color:#660">&lt;</span=
><span style=3D"color:#008">typename</span><span style=3D"color:#000"> FROM=
</span><span style=3D"color:#660">&gt;</span><span style=3D"color:#000"><br=
>=C2=A0</span><span style=3D"color:#008">struct</span><span style=3D"color:=
#000"> my_is_convertable<br>=C2=A0</span><span style=3D"color:#660">{</span=
><span style=3D"color:#000"><br>=C2=A0 =C2=A0</span><span style=3D"color:#0=
08">template</span><span style=3D"color:#000"> </span><span style=3D"color:=
#660">&lt;</span><span style=3D"color:#008">typename</span><span style=3D"c=
olor:#000"> TO</span><span style=3D"color:#660">&gt;</span><span style=3D"c=
olor:#000"><br>=C2=A0 =C2=A0</span><span style=3D"color:#008">using</span><=
span style=3D"color:#000"> ttype </span><span style=3D"color:#660">=3D</spa=
n><span style=3D"color:#000"> std</span><span style=3D"color:#660">::</span=
><span style=3D"color:#000">is_convertable</span><span style=3D"color:#660"=
>&lt;</span><span style=3D"color:#000">FROM</span><span style=3D"color:#660=
">,</span><span style=3D"color:#000"> TO</span><span style=3D"color:#660">&=
gt;;</span><span style=3D"color:#000"><br>=C2=A0</span><span style=3D"color=
:#660">};</span><span style=3D"color:#000"><br></span></div></code></div><d=
iv><br>And use it like this:</div><div><br></div> <div 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><div><span style=3D"color:#000">=
=C2=A0find</span><span style=3D"color:#660">&lt;</span><span style=3D"color=
:#000">my_is_convertable</span><span style=3D"color:#080">&lt;int&gt;</span=
><span style=3D"color:#660">::</span><span style=3D"color:#008"><wbr>templa=
te</span><span style=3D"color:#000"> ttype</span><span style=3D"color:#660"=
>,</span><span style=3D"color:#000"> </span><span style=3D"color:#008">floa=
t</span><span style=3D"color:#660">,</span><span style=3D"color:#000"> </sp=
an><span style=3D"color:#008">int</span><span style=3D"color:#000"> </span>=
<span style=3D"color:#008">double</span><span style=3D"color:#660">&gt;::</=
span><span style=3D"color:#000">value<br></span></div></code></div><div><br=
>I propose that instead we use this syntax to define partial template alias=
ing:</div><div><br></div><div style=3D"background-color:rgb(250,250,250);bo=
rder-color:rgb(187,187,187);border-style:solid;border-width:1px;word-wrap:b=
reak-word"><code><div><span style=3D"color:#000">=C2=A0</span><span style=
=3D"color:#008">template</span><span style=3D"color:#000"> </span><span sty=
le=3D"color:#660">&lt;</span><span style=3D"color:#008">typename</span><spa=
n style=3D"color:#000"> TO</span><span style=3D"color:#660">&gt;</span><spa=
n style=3D"color:#000"><br>=C2=A0</span><span style=3D"color:#008">template=
</span><span style=3D"color:#000"> </span><span style=3D"color:#660">&lt;</=
span><span style=3D"color:#008">typename</span><span style=3D"color:#000"> =
FROM</span><span style=3D"color:#660">&gt;</span><span style=3D"color:#000"=
><br>=C2=A0</span><span style=3D"color:#008">using</span><span style=3D"col=
or:#000"> is_convertable </span><span style=3D"color:#660">=3D</span><span =
style=3D"color:#000"> std</span><span style=3D"color:#660">::</span><span s=
tyle=3D"color:#000">is_convertable</span><span style=3D"color:#660">&lt;</s=
pan><span style=3D"color:#000">TO</span><span style=3D"color:#660">,</span>=
<span style=3D"color:#000"> FROM</span><span style=3D"color:#660">&gt;;</sp=
an><span style=3D"color:#000"><br><br>=C2=A0find</span><span style=3D"color=
:#660">&lt;</span><span style=3D"color:#000">my_is_convertable</span><span =
style=3D"color:#080">&lt;int&gt;</span><span style=3D"color:#660">,</span><=
span style=3D"color:#000"> </span><span style=3D"color:#008">float</span><s=
pan style=3D"color:#660">,</span><span style=3D"color:#000"> </span><span s=
tyle=3D"color:#008">int</span><span style=3D"color:#000"> </span><span styl=
e=3D"color:#008">double</span><span style=3D"color:#660">&gt;::</span><span=
 style=3D"color:#000">value</span></div></code></div><div><br></div><div>Th=
is would also make this valid:</div><div><br></div><div style=3D"background=
-color:rgb(250,250,250);border-color:rgb(187,187,187);border-style:solid;bo=
rder-width:1px;word-wrap:break-word"><code><div><span style=3D"color:#000">=
=C2=A0my_is_convertable</span><span style=3D"color:#080">&lt;int&gt;&lt;int=
&gt;</span><span style=3D"color:#660">::</span><span style=3D"color:#000"><=
wbr>value<br></span></div></code></div><div><br></div><div>Which should be =
fine.</div><div><br></div><div>Pros:</div><div><br></div><div>Verbosity is =
lowered, no more need for referring to an embedded template is required whi=
ch follows that the need for the template keyword is also removed, all of w=
hich reducing noise.=C2=A0 Also it would not break anything in the wild.=C2=
=A0 This would also mostly remove the need for <font face=3D"courier new, m=
onospace">tbind</font>, except in cases where symbol leakage is not wanted =
in the enclosing scope.=C2=A0=C2=A0</div><div><br></div><div>Cons:</div><di=
v><br></div><div>Developers would need to get used to the syntax.=C2=A0 Not=
hing too crazy though.=C2=A0=C2=A0</div><div><br></div><div>What is everyon=
e&#39;s opinion on this?</div><div><br></div></div></blockquote><div>=C2=A0=
</div>Right now I see only one problem with this:<br><div style=3D"backgrou=
nd-color: rgb(250, 250, 250); border-color: rgb(187, 187, 187); border-styl=
e: solid; border-width: 1px; overflow-wrap: break-word;" class=3D"prettypri=
nt"><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: #000;" class=3D"styled-by-prettify"> A</span><span style=3D"color: #660;=
" class=3D"styled-by-prettify">&gt;</span><span style=3D"color: #000;" clas=
s=3D"styled-by-prettify"><br></span><span style=3D"color: #008;" class=3D"s=
tyled-by-prettify">using</span><span style=3D"color: #000;" class=3D"styled=
-by-prettify"> B </span><span style=3D"color: #660;" class=3D"styled-by-pre=
ttify">=3D</span><span style=3D"color: #000;" class=3D"styled-by-prettify">=
 </span><span style=3D"color: #008;" class=3D"styled-by-prettify">typename<=
/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><span styl=
e=3D"color: #008;" class=3D"styled-by-prettify">template</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color=
: #008;" class=3D"styled-by-prettify">template</span><span style=3D"color: =
#000;" class=3D"styled-by-prettify"> temp</span><span style=3D"color: #660;=
" class=3D"styled-by-prettify">&lt;</span><span style=3D"color: #066;" clas=
s=3D"styled-by-prettify">1</span><span style=3D"color: #660;" class=3D"styl=
ed-by-prettify">&gt;&lt;</span><span style=3D"color: #066;" class=3D"styled=
-by-prettify">2</span><span style=3D"color: #660;" class=3D"styled-by-prett=
ify">&gt;;</span><span style=3D"color: #000;" class=3D"styled-by-prettify">=
<br></span><span style=3D"color: #800;" class=3D"styled-by-prettify">//or</=
span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br></span><=
span style=3D"color: #008;" class=3D"styled-by-prettify">template</span><sp=
an style=3D"color: #660;" class=3D"styled-by-prettify">&lt;</span><span sty=
le=3D"color: #008;" class=3D"styled-by-prettify">typename</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> A</span><span style=3D"colo=
r: #660;" class=3D"styled-by-prettify">&gt;</span><span style=3D"color: #00=
0;" class=3D"styled-by-prettify"><br></span><span style=3D"color: #008;" cl=
ass=3D"styled-by-prettify">using</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> C </span><span style=3D"color: #660;" class=3D"sty=
led-by-prettify">=3D</span><span style=3D"color: #000;" class=3D"styled-by-=
prettify"> </span><span style=3D"color: #008;" class=3D"styled-by-prettify"=
>template</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: #008;" class=3D"styled-by-prettify">template</span><s=
pan style=3D"color: #000;" class=3D"styled-by-prettify"> temp</span><span s=
tyle=3D"color: #660;" class=3D"styled-by-prettify">&lt;</span><span style=
=3D"color: #066;" class=3D"styled-by-prettify">1</span><span style=3D"color=
: #660;" class=3D"styled-by-prettify">&gt;;</span><span style=3D"color: #00=
0;" class=3D"styled-by-prettify"> </span><span style=3D"color: #800;" class=
=3D"styled-by-prettify">//this return template not type, this could be prob=
lematic when C++20 remove options for different `using`</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"><br></span><span style=3D"co=
lor: #800;" class=3D"styled-by-prettify">//or</span><span style=3D"color: #=
000;" class=3D"styled-by-prettify"><br></span><span style=3D"color: #008;" =
class=3D"styled-by-prettify">template</span><span style=3D"color: #660;" cl=
ass=3D"styled-by-prettify">&lt;</span><span style=3D"color: #008;" class=3D=
"styled-by-prettify">typename</span><span style=3D"color: #000;" class=3D"s=
tyled-by-prettify"> A</span><span style=3D"color: #660;" class=3D"styled-by=
-prettify">&gt;</span><span style=3D"color: #000;" class=3D"styled-by-prett=
ify"><br></span><span style=3D"color: #008;" class=3D"styled-by-prettify">u=
sing</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> D </s=
pan><span style=3D"color: #660;" class=3D"styled-by-prettify">=3D</span><sp=
an style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=
=3D"color: #008;" class=3D"styled-by-prettify">template</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color=
: #008;" class=3D"styled-by-prettify">template</span><span style=3D"color: =
#000;" class=3D"styled-by-prettify"> A</span><span style=3D"color: #660;" c=
lass=3D"styled-by-prettify">::</span><span style=3D"color: #000;" class=3D"=
styled-by-prettify">temp</span><span style=3D"color: #660;" class=3D"styled=
-by-prettify">;</span><span style=3D"color: #000;" class=3D"styled-by-prett=
ify"><br></span></div></code></div>You will probably need something like th=
is to allow proper handle of `&lt;` and `&gt;` by compiler in dependent con=
text.<br><br></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/7eb526d4-c557-443c-a7d5-235dc8e44926%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/7eb526d4-c557-443c-a7d5-235dc8e44926=
%40isocpp.org</a>.<br />

------=_Part_5970_2088822440.1513559909253--

------=_Part_5969_1092391641.1513559909252--

.


Author: adrian.hawryluk@gmail.com
Date: Sun, 17 Dec 2017 21:28:12 -0800 (PST)
Raw View
------=_Part_16473_87918497.1513574892406
Content-Type: multipart/alternative;
 boundary="----=_Part_16474_1249384717.1513574892407"

------=_Part_16474_1249384717.1513574892407
Content-Type: text/plain; charset="UTF-8"

On Sunday, December 17, 2017 at 8:18:29 PM UTC-5, Marcin Jaczewski wrote:
>
>
> Right now I see only one problem with this:
> template<typename A>
> using B = typename A::template template temp<1><2>;
> //or
> template<typename A>
> using C = template A::template temp<1>; //this return template not type,
> this could be problematic when C++20 remove options for different `using`
> //or
> template<typename A>
> using D = template template A::temp;
> You will probably need something like this to allow proper handle of `<`
> and `>` by compiler in dependent context.
>

I'm not exactly sure what you mean.  So, these are potential ways to tell
the compiler what it should be seeing?  temp is a binary operator?  What is
A?  Could you please give more context or explain in more detail what you
are attempting to say?

--
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/6d5434aa-a3bd-460f-bdbd-3db00772768a%40isocpp.org.

------=_Part_16474_1249384717.1513574892407
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Sunday, December 17, 2017 at 8:18:29 PM UTC-5, Marcin J=
aczewski wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-=
left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr=
"><br>Right now I see only one problem with this:<br><div style=3D"backgrou=
nd-color:rgb(250,250,250);border-color:rgb(187,187,187);border-style:solid;=
border-width:1px"><code><div><span style=3D"color:#008">template</span><spa=
n style=3D"color:#660">&lt;</span><span style=3D"color:#008">typename</span=
><span style=3D"color:#000"> A</span><span style=3D"color:#660">&gt;</span>=
<span style=3D"color:#000"><br></span><span style=3D"color:#008">using</spa=
n><span style=3D"color:#000"> B </span><span style=3D"color:#660">=3D</span=
><span style=3D"color:#000"> </span><span style=3D"color:#008">typename</sp=
an><span style=3D"color:#000"> A</span><span style=3D"color:#660">::</span>=
<span style=3D"color:#008">template</span><span style=3D"color:#000"> </spa=
n><span style=3D"color:#008">template</span><span style=3D"color:#000"> tem=
p</span><span style=3D"color:#660">&lt;</span><span style=3D"color:#066">1<=
/span><span style=3D"color:#660">&gt;&lt;</span><span style=3D"color:#066">=
2</span><span style=3D"color:#660">&gt;;</span><span style=3D"color:#000"><=
br></span><span style=3D"color:#800">//or</span><span style=3D"color:#000">=
<br></span><span style=3D"color:#008">template</span><span style=3D"color:#=
660">&lt;</span><span style=3D"color:#008">typename</span><span style=3D"co=
lor:#000"> A</span><span style=3D"color:#660">&gt;</span><span style=3D"col=
or:#000"><br></span><span style=3D"color:#008">using</span><span style=3D"c=
olor:#000"> C </span><span style=3D"color:#660">=3D</span><span style=3D"co=
lor:#000"> </span><span style=3D"color:#008">template</span><span style=3D"=
color:#000"> A</span><span style=3D"color:#660">::</span><span style=3D"col=
or:#008">template</span><span style=3D"color:#000"> temp</span><span style=
=3D"color:#660">&lt;</span><span style=3D"color:#066">1</span><span style=
=3D"color:#660">&gt;;</span><span style=3D"color:#000"> </span><span style=
=3D"color:#800">//this return template not type, this could be problematic =
when C++20 remove options for different `using`</span><span style=3D"color:=
#000"><br></span><span style=3D"color:#800">//or</span><span style=3D"color=
:#000"><br></span><span style=3D"color:#008">template</span><span style=3D"=
color:#660">&lt;</span><span style=3D"color:#008">typename</span><span styl=
e=3D"color:#000"> A</span><span style=3D"color:#660">&gt;</span><span style=
=3D"color:#000"><br></span><span style=3D"color:#008">using</span><span sty=
le=3D"color:#000"> D </span><span style=3D"color:#660">=3D</span><span styl=
e=3D"color:#000"> </span><span style=3D"color:#008">template</span><span st=
yle=3D"color:#000"> </span><span style=3D"color:#008">template</span><span =
style=3D"color:#000"> A</span><span style=3D"color:#660">::</span><span sty=
le=3D"color:#000">temp</span><span style=3D"color:#660">;</span><span style=
=3D"color:#000"><br></span></div></code></div>You will probably need someth=
ing like this to allow proper handle of `&lt;` and `&gt;` by compiler in de=
pendent context.<br></div></blockquote><div><br></div><div>I&#39;m not exac=
tly sure what you mean.=C2=A0=C2=A0So, these are potential ways to tell the=
 compiler what it should be seeing?=C2=A0 <font face=3D"courier new, monosp=
ace">temp</font> is a binary operator?=C2=A0 What is <font face=3D"courier =
new, monospace">A</font>?=C2=A0 Could you please give more context or expla=
in in more detail what you are attempting to say?</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/6d5434aa-a3bd-460f-bdbd-3db00772768a%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/6d5434aa-a3bd-460f-bdbd-3db00772768a=
%40isocpp.org</a>.<br />

------=_Part_16474_1249384717.1513574892407--

------=_Part_16473_87918497.1513574892406--

.


Author: inkwizytoryankes@gmail.com
Date: Mon, 18 Dec 2017 12:56:36 -0800 (PST)
Raw View
------=_Part_7262_1591443954.1513630597046
Content-Type: multipart/alternative;
 boundary="----=_Part_7263_1002987415.1513630597047"

------=_Part_7263_1002987415.1513630597047
Content-Type: text/plain; charset="UTF-8"



On Monday, December 18, 2017 at 6:28:12 AM UTC+1, adrian....@gmail.com
wrote:
>
> On Sunday, December 17, 2017 at 8:18:29 PM UTC-5, Marcin Jaczewski wrote:
>>
>>
>> Right now I see only one problem with this:
>> template<typename A>
>> using B = typename A::template template temp<1><2>;
>> //or
>> template<typename A>
>> using C = template A::template temp<1>; //this return template not type,
>> this could be problematic when C++20 remove options for different `using`
>> //or
>> template<typename A>
>> using D = template template A::temp;
>> You will probably need something like this to allow proper handle of `<`
>> and `>` by compiler in dependent context.
>>
>
> I'm not exactly sure what you mean.  So, these are potential ways to tell
> the compiler what it should be seeing?  temp is a binary operator?  What
> is A?  Could you please give more context or explain in more detail what
> you are attempting to say?
>

What is `temp`? This is good question that your proposal should answer
because it's dependent name on template parameter `A`. If we implements
your proposition how you will access it if it is in dependent context?
Right now we have way to distinguish between objects, types and templates,
now with your proposal we will need new way to support your first class
aliases.

--
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/90bc6ae9-54a4-4fe5-b4ee-a32db51ca820%40isocpp.org.

------=_Part_7263_1002987415.1513630597047
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>On Monday, December 18, 2017 at 6:28:12 AM UTC+1, =
adrian....@gmail.com wrote:<blockquote class=3D"gmail_quote" style=3D"margi=
n: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><di=
v dir=3D"ltr">On Sunday, December 17, 2017 at 8:18:29 PM UTC-5, Marcin Jacz=
ewski wrote:<blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left=
:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><br>Ri=
ght now I see only one problem with this:<br><div style=3D"background-color=
:rgb(250,250,250);border-color:rgb(187,187,187);border-style:solid;border-w=
idth:1px"><code><div><span style=3D"color:#008">template</span><span style=
=3D"color:#660">&lt;</span><span style=3D"color:#008">typename</span><span =
style=3D"color:#000"> A</span><span style=3D"color:#660">&gt;</span><span s=
tyle=3D"color:#000"><br></span><span style=3D"color:#008">using</span><span=
 style=3D"color:#000"> B </span><span style=3D"color:#660">=3D</span><span =
style=3D"color:#000"> </span><span style=3D"color:#008">typename</span><spa=
n style=3D"color:#000"> A</span><span style=3D"color:#660">::</span><span s=
tyle=3D"color:#008">template</span><span style=3D"color:#000"> </span><span=
 style=3D"color:#008">template</span><span style=3D"color:#000"> temp</span=
><span style=3D"color:#660">&lt;</span><span style=3D"color:#066">1</span><=
span style=3D"color:#660">&gt;&lt;</span><span style=3D"color:#066">2</span=
><span style=3D"color:#660">&gt;;</span><span style=3D"color:#000"><br></sp=
an><span style=3D"color:#800">//or</span><span style=3D"color:#000"><br></s=
pan><span style=3D"color:#008">template</span><span style=3D"color:#660">&l=
t;</span><span style=3D"color:#008">typename</span><span style=3D"color:#00=
0"> A</span><span style=3D"color:#660">&gt;</span><span style=3D"color:#000=
"><br></span><span style=3D"color:#008">using</span><span style=3D"color:#0=
00"> C </span><span style=3D"color:#660">=3D</span><span style=3D"color:#00=
0"> </span><span style=3D"color:#008">template</span><span style=3D"color:#=
000"> A</span><span style=3D"color:#660">::</span><span style=3D"color:#008=
">template</span><span style=3D"color:#000"> temp</span><span style=3D"colo=
r:#660">&lt;</span><span style=3D"color:#066">1</span><span style=3D"color:=
#660">&gt;;</span><span style=3D"color:#000"> </span><span style=3D"color:#=
800">//this return template not type, this could be problematic when C++20 =
remove options for different `using`</span><span style=3D"color:#000"><br><=
/span><span style=3D"color:#800">//or</span><span style=3D"color:#000"><br>=
</span><span style=3D"color:#008">template</span><span style=3D"color:#660"=
>&lt;</span><span style=3D"color:#008">typename</span><span style=3D"color:=
#000"> A</span><span style=3D"color:#660">&gt;</span><span style=3D"color:#=
000"><br></span><span style=3D"color:#008">using</span><span style=3D"color=
:#000"> D </span><span style=3D"color:#660">=3D</span><span style=3D"color:=
#000"> </span><span style=3D"color:#008">template</span><span style=3D"colo=
r:#000"> </span><span style=3D"color:#008">template</span><span style=3D"co=
lor:#000"> A</span><span style=3D"color:#660">::</span><span style=3D"color=
:#000">temp</span><span style=3D"color:#660">;</span><span style=3D"color:#=
000"><br></span></div></code></div>You will probably need something like th=
is to allow proper handle of `&lt;` and `&gt;` by compiler in dependent con=
text.<br></div></blockquote><div><br></div><div>I&#39;m not exactly sure wh=
at you mean.=C2=A0=C2=A0So, these are potential ways to tell the compiler w=
hat it should be seeing?=C2=A0 <font face=3D"courier new, monospace">temp</=
font> is a binary operator?=C2=A0 What is <font face=3D"courier new, monosp=
ace">A</font>?=C2=A0 Could you please give more context or explain in more =
detail what you are attempting to say?</div></div></blockquote><br>What is =
`temp`? This is good question that your proposal should answer because it&#=
39;s dependent name on template parameter `A`. If we implements your propos=
ition how you will access it if it is in dependent context?<br>Right now we=
 have way to <span id=3D"result_box" class=3D"short_text" lang=3D"en"><span=
 class=3D"">distinguish </span></span>between objects, types and templates,=
 now with your proposal we will need new way to support your first class al=
iases.<br></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/90bc6ae9-54a4-4fe5-b4ee-a32db51ca820%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/90bc6ae9-54a4-4fe5-b4ee-a32db51ca820=
%40isocpp.org</a>.<br />

------=_Part_7263_1002987415.1513630597047--

------=_Part_7262_1591443954.1513630597046--

.


Author: Jack Adrian Zappa <adrian.hawryluk@gmail.com>
Date: Tue, 19 Dec 2017 05:47:55 -0800 (PST)
Raw View
------=_Part_28421_793900392.1513691275161
Content-Type: multipart/alternative;
 boundary="----=_Part_28422_2016807006.1513691275162"

------=_Part_28422_2016807006.1513691275162
Content-Type: text/plain; charset="UTF-8"

On Monday, December 18, 2017 at 3:56:37 PM UTC-5, Marcin Jaczewski wrote:
>
>
>
> On Monday, December 18, 2017 at 6:28:12 AM UTC+1, adrian....@gmail.com
> wrote:
>>
>> On Sunday, December 17, 2017 at 8:18:29 PM UTC-5, Marcin Jaczewski wrote:
>>>
>>>
>>> Right now I see only one problem with this:
>>> template<typename A>
>>> using B = typename A::template template temp<1><2>;
>>> //or
>>> template<typename A>
>>> using C = template A::template temp<1>; //this return template not
>>> type, this could be problematic when C++20 remove options for different
>>> `using`
>>> //or
>>> template<typename A>
>>> using D = template template A::temp;
>>> You will probably need something like this to allow proper handle of `<`
>>> and `>` by compiler in dependent context.
>>>
>>
>> I'm not exactly sure what you mean.  So, these are potential ways to tell
>> the compiler what it should be seeing?  temp is a binary operator?  What
>> is A?  Could you please give more context or explain in more detail what
>> you are attempting to say?
>>
>
> What is `temp`? This is good question that your proposal should answer
> because it's dependent name on template parameter `A`. If we implements
> your proposition how you will access it if it is in dependent context?
> Right now we have way to distinguish between objects, types and
> templates, now with your proposal we will need new way to support your
> first class aliases.
>

Ah, sorry.  Not sure how I misread that.  If I understand the current
parsing of C++, I think your 1st one is most appropriate.  Also, could you
expand on what you mean by your 2nd item being possibly problematic in
c++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 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/a366da24-92ff-4011-99a9-4aca60390142%40isocpp.org.

------=_Part_28422_2016807006.1513691275162
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Monday, December 18, 2017 at 3:56:37 PM UTC-5, Marcin J=
aczewski wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-=
left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr=
"><br><br>On Monday, December 18, 2017 at 6:28:12 AM UTC+1, <a>adrian....@g=
mail.com</a> wrote:<blockquote class=3D"gmail_quote" style=3D"margin:0;marg=
in-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"=
>On Sunday, December 17, 2017 at 8:18:29 PM UTC-5, Marcin Jaczewski wrote:<=
blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border=
-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><br>Right now I see=
 only one problem with this:<br><div style=3D"background-color:rgb(250,250,=
250);border-color:rgb(187,187,187);border-style:solid;border-width:1px"><co=
de><div><span style=3D"color:#008">template</span><span style=3D"color:#660=
">&lt;</span><span style=3D"color:#008">typename</span><span style=3D"color=
:#000"> A</span><span style=3D"color:#660">&gt;</span><span style=3D"color:=
#000"><br></span><span style=3D"color:#008">using</span><span style=3D"colo=
r:#000"> B </span><span style=3D"color:#660">=3D</span><span style=3D"color=
:#000"> </span><span style=3D"color:#008">typename</span><span style=3D"col=
or:#000"> A</span><span style=3D"color:#660">::</span><span style=3D"color:=
#008">template</span><span style=3D"color:#000"> </span><span style=3D"colo=
r:#008">template</span><span style=3D"color:#000"> temp</span><span style=
=3D"color:#660">&lt;</span><span style=3D"color:#066">1</span><span style=
=3D"color:#660">&gt;&lt;</span><span style=3D"color:#066">2</span><span sty=
le=3D"color:#660">&gt;;</span><span style=3D"color:#000"><br></span><span s=
tyle=3D"color:#800">//or</span><span style=3D"color:#000"><br></span><span =
style=3D"color:#008">template</span><span style=3D"color:#660">&lt;</span><=
span style=3D"color:#008">typename</span><span style=3D"color:#000"> A</spa=
n><span style=3D"color:#660">&gt;</span><span style=3D"color:#000"><br></sp=
an><span style=3D"color:#008">using</span><span style=3D"color:#000"> C </s=
pan><span style=3D"color:#660">=3D</span><span style=3D"color:#000"> </span=
><span style=3D"color:#008">template</span><span style=3D"color:#000"> A</s=
pan><span style=3D"color:#660">::</span><span style=3D"color:#008">template=
</span><span style=3D"color:#000"> temp</span><span style=3D"color:#660">&l=
t;</span><span style=3D"color:#066">1</span><span style=3D"color:#660">&gt;=
;</span><span style=3D"color:#000"> </span><span style=3D"color:#800">//thi=
s return template not type, this could be problematic when C++20 remove opt=
ions for different `using`</span><span style=3D"color:#000"><br></span><spa=
n style=3D"color:#800">//or</span><span style=3D"color:#000"><br></span><sp=
an style=3D"color:#008">template</span><span style=3D"color:#660">&lt;</spa=
n><span style=3D"color:#008">typename</span><span style=3D"color:#000"> A</=
span><span style=3D"color:#660">&gt;</span><span style=3D"color:#000"><br><=
/span><span style=3D"color:#008">using</span><span style=3D"color:#000"> D =
</span><span style=3D"color:#660">=3D</span><span style=3D"color:#000"> </s=
pan><span style=3D"color:#008">template</span><span style=3D"color:#000"> <=
/span><span style=3D"color:#008">template</span><span style=3D"color:#000">=
 A</span><span style=3D"color:#660">::</span><span style=3D"color:#000">tem=
p</span><span style=3D"color:#660">;</span><span style=3D"color:#000"><br><=
/span></div></code></div>You will probably need something like this to allo=
w proper handle of `&lt;` and `&gt;` by compiler in dependent context.<br><=
/div></blockquote><div><br></div><div>I&#39;m not exactly sure what you mea=
n.=C2=A0=C2=A0So, these are potential ways to tell the compiler what it sho=
uld be seeing?=C2=A0 <font face=3D"courier new, monospace">temp</font> is a=
 binary operator?=C2=A0 What is <font face=3D"courier new, monospace">A</fo=
nt>?=C2=A0 Could you please give more context or explain in more detail wha=
t you are attempting to say?</div></div></blockquote><br>What is `temp`? Th=
is is good question that your proposal should answer because it&#39;s depen=
dent name on template parameter `A`. If we implements your proposition how =
you will access it if it is in dependent context?<br>Right now we have way =
to <span lang=3D"en"><span>distinguish </span></span>between objects, types=
 and templates, now with your proposal we will need new way to support your=
 first class aliases.<br></div></blockquote><div><br></div><div>Ah, sorry.=
=C2=A0 Not sure how I misread that.=C2=A0 If I understand the current parsi=
ng of C++, I think your 1st one is most appropriate.=C2=A0 Also, could you =
expand on what you mean by your 2nd item being possibly problematic in c++2=
0?=C2=A0</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/a366da24-92ff-4011-99a9-4aca60390142%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/a366da24-92ff-4011-99a9-4aca60390142=
%40isocpp.org</a>.<br />

------=_Part_28422_2016807006.1513691275162--

------=_Part_28421_793900392.1513691275161--

.


Author: inkwizytoryankes@gmail.com
Date: Tue, 19 Dec 2017 06:32:05 -0800 (PST)
Raw View
------=_Part_7884_1189233143.1513693925186
Content-Type: multipart/alternative;
 boundary="----=_Part_7885_1134339811.1513693925187"

------=_Part_7885_1134339811.1513693925187
Content-Type: text/plain; charset="UTF-8"



On Tuesday, December 19, 2017 at 2:47:55 PM UTC+1, Jack Adrian Zappa wrote:
>
> On Monday, December 18, 2017 at 3:56:37 PM UTC-5, Marcin Jaczewski wrote:
>>
>>
>>
>> On Monday, December 18, 2017 at 6:28:12 AM UTC+1, adrian....@gmail.com
>> wrote:
>>>
>>> On Sunday, December 17, 2017 at 8:18:29 PM UTC-5, Marcin Jaczewski wrote:
>>>>
>>>>
>>>> Right now I see only one problem with this:
>>>> template<typename A>
>>>> using B = typename A::template template temp<1><2>;
>>>> //or
>>>> template<typename A>
>>>> using C = template A::template temp<1>; //this return template not
>>>> type, this could be problematic when C++20 remove options for different
>>>> `using`
>>>> //or
>>>> template<typename A>
>>>> using D = template template A::temp;
>>>> You will probably need something like this to allow proper handle of
>>>> `<` and `>` by compiler in dependent context.
>>>>
>>>
>>> I'm not exactly sure what you mean.  So, these are potential ways to
>>> tell the compiler what it should be seeing?  temp is a binary
>>> operator?  What is A?  Could you please give more context or explain in
>>> more detail what you are attempting to say?
>>>
>>
>> What is `temp`? This is good question that your proposal should answer
>> because it's dependent name on template parameter `A`. If we implements
>> your proposition how you will access it if it is in dependent context?
>> Right now we have way to distinguish between objects, types and
>> templates, now with your proposal we will need new way to support your
>> first class aliases.
>>
>
> Ah, sorry.  Not sure how I misread that.  If I understand the current
> parsing of C++, I think your 1st one is most appropriate.  Also, could you
> expand on what you mean by your 2nd item being possibly problematic in
> c++20?
>

Last one is similar in functionality to your declaration:
template<int I>
template<int J>
template<typename A>
using B = typename A::template template temp<I><J>;

template<typename A>
using C = template template A::temp;

One difference is that in my case we would not need what template
parameters are needed for `temp`

For 2nd I referring to
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0634r0.pdf now
depending what syntax you will want use this proposal will or will not
affect it. This it simply thing to consider when you are choosing syntax
for this 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/0f7bbb29-e28c-4600-a2f6-fba0a80fec3d%40isocpp.org.

------=_Part_7885_1134339811.1513693925187
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>On Tuesday, December 19, 2017 at 2:47:55 PM UTC+1,=
 Jack Adrian Zappa wrote:<blockquote class=3D"gmail_quote" style=3D"margin:=
 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div =
dir=3D"ltr">On Monday, December 18, 2017 at 3:56:37 PM UTC-5, Marcin Jaczew=
ski wrote:<blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0=
..8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><br><br>=
On Monday, December 18, 2017 at 6:28:12 AM UTC+1, <a>adrian....@gmail.com</=
a> wrote:<blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.=
8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">On Sunday=
, December 17, 2017 at 8:18:29 PM UTC-5, Marcin Jaczewski wrote:<blockquote=
 class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px =
#ccc solid;padding-left:1ex"><div dir=3D"ltr"><br>Right now I see only one =
problem with this:<br><div style=3D"background-color:rgb(250,250,250);borde=
r-color:rgb(187,187,187);border-style:solid;border-width:1px"><code><div><s=
pan style=3D"color:#008">template</span><span style=3D"color:#660">&lt;</sp=
an><span style=3D"color:#008">typename</span><span style=3D"color:#000"> A<=
/span><span style=3D"color:#660">&gt;</span><span style=3D"color:#000"><br>=
</span><span style=3D"color:#008">using</span><span style=3D"color:#000"> B=
 </span><span style=3D"color:#660">=3D</span><span style=3D"color:#000"> </=
span><span style=3D"color:#008">typename</span><span style=3D"color:#000"> =
A</span><span style=3D"color:#660">::</span><span style=3D"color:#008">temp=
late</span><span style=3D"color:#000"> </span><span style=3D"color:#008">te=
mplate</span><span style=3D"color:#000"> temp</span><span style=3D"color:#6=
60">&lt;</span><span style=3D"color:#066">1</span><span style=3D"color:#660=
">&gt;&lt;</span><span style=3D"color:#066">2</span><span style=3D"color:#6=
60">&gt;;</span><span style=3D"color:#000"><br></span><span style=3D"color:=
#800">//or</span><span style=3D"color:#000"><br></span><span style=3D"color=
:#008">template</span><span style=3D"color:#660">&lt;</span><span style=3D"=
color:#008">typename</span><span style=3D"color:#000"> A</span><span style=
=3D"color:#660">&gt;</span><span style=3D"color:#000"><br></span><span styl=
e=3D"color:#008">using</span><span style=3D"color:#000"> C </span><span sty=
le=3D"color:#660">=3D</span><span style=3D"color:#000"> </span><span style=
=3D"color:#008">template</span><span style=3D"color:#000"> A</span><span st=
yle=3D"color:#660">::</span><span style=3D"color:#008">template</span><span=
 style=3D"color:#000"> temp</span><span style=3D"color:#660">&lt;</span><sp=
an style=3D"color:#066">1</span><span style=3D"color:#660">&gt;;</span><spa=
n style=3D"color:#000"> </span><span style=3D"color:#800">//this return tem=
plate not type, this could be problematic when C++20 remove options for dif=
ferent `using`</span><span style=3D"color:#000"><br></span><span style=3D"c=
olor:#800">//or</span><span style=3D"color:#000"><br></span><span style=3D"=
color:#008">template</span><span style=3D"color:#660">&lt;</span><span styl=
e=3D"color:#008">typename</span><span style=3D"color:#000"> A</span><span s=
tyle=3D"color:#660">&gt;</span><span style=3D"color:#000"><br></span><span =
style=3D"color:#008">using</span><span style=3D"color:#000"> D </span><span=
 style=3D"color:#660">=3D</span><span style=3D"color:#000"> </span><span st=
yle=3D"color:#008">template</span><span style=3D"color:#000"> </span><span =
style=3D"color:#008">template</span><span style=3D"color:#000"> A</span><sp=
an style=3D"color:#660">::</span><span style=3D"color:#000">temp</span><spa=
n style=3D"color:#660">;</span><span style=3D"color:#000"><br></span></div>=
</code></div>You will probably need something like this to allow proper han=
dle of `&lt;` and `&gt;` by compiler in dependent context.<br></div></block=
quote><div><br></div><div>I&#39;m not exactly sure what you mean.=C2=A0=C2=
=A0So, these are potential ways to tell the compiler what it should be seei=
ng?=C2=A0 <font face=3D"courier new, monospace">temp</font> is a binary ope=
rator?=C2=A0 What is <font face=3D"courier new, monospace">A</font>?=C2=A0 =
Could you please give more context or explain in more detail what you are a=
ttempting to say?</div></div></blockquote><br>What is `temp`? This is good =
question that your proposal should answer because it&#39;s dependent name o=
n template parameter `A`. If we implements your proposition how you will ac=
cess it if it is in dependent context?<br>Right now we have way to <span la=
ng=3D"en"><span>distinguish </span></span>between objects, types and templa=
tes, now with your proposal we will need new way to support your first clas=
s aliases.<br></div></blockquote><div><br></div><div>Ah, sorry.=C2=A0 Not s=
ure how I misread that.=C2=A0 If I understand the current parsing of C++, I=
 think your 1st one is most appropriate.=C2=A0 Also, could you expand on wh=
at you mean by your 2nd item being possibly problematic in c++20?=C2=A0</di=
v></div></blockquote><div>=C2=A0</div><div>Last one is similar in functiona=
lity to your declaration:</div><div><div style=3D"background-color: rgb(250=
, 250, 250); border-color: rgb(187, 187, 187); border-style: solid; border-=
width: 1px; overflow-wrap: break-word;" class=3D"prettyprint"><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;" c=
lass=3D"styled-by-prettify">&lt;</span><span style=3D"color: #008;" class=
=3D"styled-by-prettify">int</span><span style=3D"color: #000;" class=3D"sty=
led-by-prettify"> I</span><span style=3D"color: #660;" class=3D"styled-by-p=
rettify">&gt;</span><span style=3D"color: #000;" class=3D"styled-by-prettif=
y"><br></span><span style=3D"color: #008;" class=3D"styled-by-prettify">tem=
plate</span><span style=3D"color: #660;" class=3D"styled-by-prettify">&lt;<=
/span><span style=3D"color: #008;" class=3D"styled-by-prettify">int</span><=
span style=3D"color: #000;" class=3D"styled-by-prettify"> J</span><span sty=
le=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">template</span><span style=3D"color: #=
660;" class=3D"styled-by-prettify">&lt;</span><span style=3D"color: #008;" =
class=3D"styled-by-prettify">typename</span><span style=3D"color: #000;" cl=
ass=3D"styled-by-prettify"> A</span><span style=3D"color: #660;" class=3D"s=
tyled-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-pre=
ttify">using</span><span style=3D"color: #000;" class=3D"styled-by-prettify=
"> B </span><span style=3D"color: #660;" class=3D"styled-by-prettify">=3D</=
span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><spa=
n style=3D"color: #008;" class=3D"styled-by-prettify">typename</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: =
#008;" class=3D"styled-by-prettify">template</span><span style=3D"color: #0=
00;" class=3D"styled-by-prettify"> </span><span style=3D"color: #008;" clas=
s=3D"styled-by-prettify">template</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> temp</span><span style=3D"color: #660;" class=3D"s=
tyled-by-prettify">&lt;</span><span style=3D"color: #000;" class=3D"styled-=
by-prettify">I</span><span style=3D"color: #660;" class=3D"styled-by-pretti=
fy">&gt;&lt;</span><span style=3D"color: #000;" class=3D"styled-by-prettify=
">J</span><span style=3D"color: #660;" class=3D"styled-by-prettify">&gt;;</=
span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br><br></sp=
an><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"styled-by-prettify">typename</span><span s=
tyle=3D"color: #000;" class=3D"styled-by-prettify"> A</span><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">using</span><span style=3D"color: #000;" cla=
ss=3D"styled-by-prettify"> C </span><span style=3D"color: #660;" class=3D"s=
tyled-by-prettify">=3D</span><span style=3D"color: #000;" class=3D"styled-b=
y-prettify"> </span><span style=3D"color: #008;" class=3D"styled-by-prettif=
y">template</span><span style=3D"color: #000;" class=3D"styled-by-prettify"=
> </span><span style=3D"color: #008;" class=3D"styled-by-prettify">template=
</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 sty=
le=3D"color: #000;" class=3D"styled-by-prettify">temp</span><span style=3D"=
color: #660;" class=3D"styled-by-prettify">;</span><span style=3D"color: #0=
00;" class=3D"styled-by-prettify"><br><br></span></div></code></div>One dif=
ference is that in my case we would not need what template parameters are n=
eeded for `temp`</div><div><br></div><div>For 2nd I referring to http://www=
..open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0634r0.pdf now depending wha=
t syntax you will want use this proposal will or will not affect it. This i=
t simply thing to consider when you are choosing syntax for this proposal.<=
br></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/0f7bbb29-e28c-4600-a2f6-fba0a80fec3d%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/0f7bbb29-e28c-4600-a2f6-fba0a80fec3d=
%40isocpp.org</a>.<br />

------=_Part_7885_1134339811.1513693925187--

------=_Part_7884_1189233143.1513693925186--

.


Author: Mingxin Wang <wmx16835vv@163.com>
Date: Thu, 21 Dec 2017 06:14:15 -0800 (PST)
Raw View
------=_Part_5292_382028347.1513865655504
Content-Type: multipart/alternative;
 boundary="----=_Part_5293_588116073.1513865655504"

------=_Part_5293_588116073.1513865655504
Content-Type: text/plain; charset="UTF-8"

As far as I am concerned, this feature could be mainly used on specifying
template arguments in separated semantic levels.

On the one hand, I think the motivation of this idea is probably
not sufficient enough for a *core language feature*. After all, this is a
pattern in compile-time programming and could be easily implemented with
struct templates (as illustrated in the initial post), and I did not see
the peculiarities of this pattern so that it need support at the language
level.

On the other hand, as other feedback reports, this feature introduces a new
language-level concept - template of template, which is at the same level
as the concepts of "types" and "type templates". If this concept is
standardized, a number of clauses may be reappraised. For example, should
"template of template" be a valid template argument type? Is it allowed to
declare a type or function template with templates in multiple layer?

Actually, I have handled some cases that required specifying a type
template in multiple separated semantic levels, and I found it acceptable
to design a helper struct (or class) template as a "*configurator*", e.g.:

template <class T, class Alloc, std::size_t SOO>
class Aaa; // requires concept Bbb

template <class Alloc, std::size_t SOO>
struct AaaConfigurator {
  template <class T>
  using type = Aaa<T, Alloc, SOO>;
};

template <template <class> class BbbTemplate>
class BbbUser;

template <class Alloc = DefaultAlloc, std::size_t SOO =
alignof(std::max_align_t)>
using AaaUser = BbbUser<AaaConfigurator<Alloc, SOO>::template type>;

Mingxin Wang

--
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/5088a543-efd6-4944-8a4c-0981cc33db55%40isocpp.org.

------=_Part_5293_588116073.1513865655504
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>As far as I am concerned, this feature could be mainl=
y used on specifying template arguments in separated semantic levels.</div>=
<div><br></div>On the one hand, I think the motivation of this idea is prob=
ably not=C2=A0sufficient enough for a <i>core language feature</i>. After a=
ll, this is a pattern in compile-time programming and could be easily imple=
mented with struct templates (as illustrated in the initial post), and I di=
d not see the peculiarities of this pattern so that it need support at the =
language level.<div><br></div><div>On the other hand, as other feedback rep=
orts, this feature introduces a new language-level concept - template of te=
mplate, which is at the same level as the concepts of &quot;types&quot; and=
 &quot;type templates&quot;. If this concept is standardized, a number of=
=C2=A0clauses may be reappraised. For example, should &quot;template of tem=
plate&quot; be a valid template argument type? Is it allowed to declare a t=
ype or function template with templates in multiple layer?</div><div><br></=
div><div>Actually, I have handled some cases that required specifying a typ=
e template in multiple separated semantic levels, and I found it acceptable=
 to design a helper struct (or class) template as a &quot;<i>configurator</=
i>&quot;, e.g.:</div><div><br></div><div><div class=3D"prettyprint" style=
=3D"border: 1px solid rgb(187, 187, 187); word-wrap: break-word; background=
-color: rgb(250, 250, 250);"><code class=3D"prettyprint"><div class=3D"subp=
rettyprint"><font color=3D"#660066"><div class=3D"subprettyprint">template =
&lt;class T, class Alloc, std::size_t SOO&gt;</div><div class=3D"subprettyp=
rint">class Aaa; // requires concept Bbb</div><div class=3D"subprettyprint"=
><br></div><div class=3D"subprettyprint">template &lt;class Alloc, std::siz=
e_t SOO&gt;</div><div class=3D"subprettyprint">struct AaaConfigurator {</di=
v><div class=3D"subprettyprint">=C2=A0 template &lt;class T&gt;</div><div c=
lass=3D"subprettyprint">=C2=A0 using type =3D Aaa&lt;T, Alloc, SOO&gt;;</di=
v><div class=3D"subprettyprint">};</div><div class=3D"subprettyprint"><br><=
/div><div class=3D"subprettyprint">template &lt;template &lt;class&gt; clas=
s BbbTemplate&gt;</div><div class=3D"subprettyprint">class BbbUser;</div><d=
iv class=3D"subprettyprint"><br></div><div class=3D"subprettyprint">templat=
e &lt;class Alloc =3D DefaultAlloc, std::size_t SOO =3D alignof(std::max_al=
ign_t)&gt;</div><div class=3D"subprettyprint">using AaaUser =3D BbbUser&lt;=
AaaConfigurator&lt;Alloc, SOO&gt;::template type&gt;;</div></font></div></c=
ode></div><br>Mingxin Wang</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/5088a543-efd6-4944-8a4c-0981cc33db55%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/5088a543-efd6-4944-8a4c-0981cc33db55=
%40isocpp.org</a>.<br />

------=_Part_5293_588116073.1513865655504--

------=_Part_5292_382028347.1513865655504--

.