Topic: Implicit function template arguments enabling syntax,
Author: "Ivan G." <nekotekina@gmail.com>
Date: Wed, 7 Sep 2016 07:01:19 -0700 (PDT)
Raw View
------=_Part_474_1119616129.1473256879493
Content-Type: multipart/alternative;
boundary="----=_Part_475_24200081.1473256879493"
------=_Part_475_24200081.1473256879493
Content-Type: text/plain; charset=UTF-8
How about the following function template syntax? An ellipsis in the end of
template argument list would allow the function template to use extended
functionality as generic lambdas of C++14 and possibly Concepts.
template <...>
void foo(auto x)
{
}
template <typename T,...>
void bar(T x, auto y = 42)
{
}
foo(42); // OK
foo<int>(42); // Error?
bar(42); // OK
bar<int>(42); // OK
bar<int, int>(42); // Error?
I heard abbreviated templates from Concepts were criticized in related way.
This would make the difference between plain functions and function
templates more clear. Sorry if this has already been discussed.
--
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/627640bf-62bf-491e-bea9-f76eec0033ec%40isocpp.org.
------=_Part_475_24200081.1473256879493
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>How about the following function template syntax? An =
ellipsis in the end of template argument list would allow the function temp=
late to use extended functionality as generic lambdas of C++14 and possibly=
Concepts.<br></div><div><br></div><div><font face=3D"courier new,monospace=
">template <...></font></div><div><font face=3D"courier new,monospace=
">void foo(auto x)<br></font></div><div><font face=3D"courier new,monospace=
">{<br></font></div><div><font face=3D"courier new,monospace">}<br></font><=
/div><div><font face=3D"courier new,monospace"><br></font></div><div><font =
face=3D"courier new,monospace">template <typename T,...><br></font></=
div><div><font face=3D"courier new,monospace">void bar(T x, auto y =3D 42)<=
br></font></div><div><font face=3D"courier new,monospace">{<br></font></div=
><div><font face=3D"courier new,monospace">}<br></font></div><div><font fac=
e=3D"courier new,monospace"><br></font></div><div><font face=3D"courier new=
,monospace">foo(42); // OK<br></font></div><div><font face=3D"courier new,m=
onospace">foo<int>(42); // Error?<br></font></div><div><font face=3D"=
courier new,monospace">bar(42); // OK<br></font></div><div><font face=3D"co=
urier new,monospace">bar<int>(42); // OK<br></font></div><div><font f=
ace=3D"courier new,monospace">bar<int, int>(42); // Error?<br></font>=
</div><div><br></div><div>I heard abbreviated templates from Concepts were =
criticized in related way. This would make the difference between plain fun=
ctions and function templates more clear. Sorry if this has already been di=
scussed.</div><div><font face=3D"courier new,monospace"><br></font></div></=
div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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/627640bf-62bf-491e-bea9-f76eec0033ec%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/627640bf-62bf-491e-bea9-f76eec0033ec=
%40isocpp.org</a>.<br />
------=_Part_475_24200081.1473256879493--
------=_Part_474_1119616129.1473256879493--
.