Topic: [c++std-core-27226] An implementation of
Author: Bjarne Stroustrup <bjarne@stroustrup.com>
Date: Fri, 06 Mar 2015 13:09:16 -0500
Raw View
This is a multi-part message in MIME format.
--------------040700010608050100060009
Content-Type: text/plain; charset=UTF-8; format=flowed
On 3/6/2015 1:07 PM, Nicol Bolas wrote:
>
>
> On Friday, March 6, 2015 at 12:38:14 PM UTC-5, Jonathan Wakely wrote:
>
> On 6 March 2015 at 17:21, Nicol Bolas wrote:
> > Explain to me, the novice C++ programmer, why this thing which
> doesn't look
> > like a template suddenly became a template. Explain to me why I
> have to
> > implement it in a header, even though it looks exactly like
> every other
> > non-template function declaration/definition.
> >
> > To the novice C++ programmer, it isn't "all just programming."
> Whether
> > something is a template matters.
>
> Ah, the "won't somebody think of the children" argument.
>
> The answer to why it suddenly became a template is that its parameter
> is a concept, not a type. A concept is a family of types. I don't
> see
> why that should be much harder to teach than "a function template
> is a
> family of functions" and "a class template is a family of types".
>
>
> If a "family of functions" is so fundamentally different from a
> regular function that it can't be declared/defined in the same way,
> why does it look exactly like a regular function? If swapping one
> identifier for another can so radically change how you go about
> implementing something, shouldn't it be more syntactically obvious
> that you've made a major change?
>
> Without the template keyword, it doesn't look like a template. And
> therefore, it is not immediately obvious that it should be treated as
> such.
>
People will learn. Learning that
void f(auto);
implies template is kid's play compared to some things we expect people
to figure out.
--
---
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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
--------------040700010608050100060009
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">
<br>
<br>
<div class=3D"moz-cite-prefix">On 3/6/2015 1:07 PM, Nicol Bolas wrote:<=
br>
</div>
<blockquote
cite=3D"mid:465969eb-2f8b-41bb-91af-d8a9e22985e7@isocpp.org"
type=3D"cite">
<div dir=3D"ltr"><br>
<br>
On Friday, March 6, 2015 at 12:38:14 PM UTC-5, Jonathan Wakely
wrote:
<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left:
0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">On 6
March 2015 at 17:21, Nicol Bolas wrote:
<br>
> Explain to me, the novice C++ programmer, why this thing
which doesn't look
<br>
> like a template suddenly became a template. Explain to me
why I have to
<br>
> implement it in a header, even though it looks exactly
like every other
<br>
> non-template function declaration/definition.
<br>
>
<br>
> To the novice C++ programmer, it isn't "all just
programming." Whether
<br>
> something is a template matters.
<br>
<br>
Ah, the "won't somebody think of the children" argument.
<br>
<br>
The answer to why it suddenly became a template is that its
parameter
<br>
is a concept, not a type. A concept is a family of types. =C2=A0I
don't see
<br>
why that should be much harder to teach than "a function
template is a
<br>
family of functions" and "a class template is a family of
types".
<br>
</blockquote>
<div><br>
If a "family of functions" is so fundamentally different from
a regular function that it can't be declared/defined in the
same way, why does it look exactly like a regular function? If
swapping one identifier for another can so radically change
how you go about implementing something, shouldn't it be more
syntactically obvious that you've made a major change?<br>
<br>
Without the template keyword, it doesn't look like a template.
And therefore, it is not immediately obvious that it should be
treated as such.</div>
<br>
</div>
</blockquote>
<br>
People will learn. Learning that<br>
=C2=A0=C2=A0=C2=A0 void f(auto);<br>
implies template is kid's play compared to some things we expect
people to figure out.<br>
<br>
</body>
</html>
<p></p>
-- <br />
<br />
--- <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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
--------------040700010608050100060009--
.