Topic: [c++std-core-27217] An implementation of
Author: Herb Sutter <hsutter@microsoft.com>
Date: Fri, 6 Mar 2015 04:19:38 +0000
Raw View
Exactly.
Also, the populations of (1) and (3) are different sizes: I can roughly cou=
nt the number of people (1) I've heard complain that (existing or proposed)=
C++ syntax is not verbose enough and should be longer, usually in forums l=
ike these. I cannot begin to count the number of people (3) I've heard comp=
lain that C++ syntax is needlessly verbose, based on their personal experie=
nce using the language in their day jobs, usually in comparison with simila=
r features in other languages.
> What we really have
> to get into our/people's heads is that "auto" is just the weakest constra=
int.
> Even a concept that requires nothing is stronger because "void
> ff(Unconstrained, Unconstrained);" will not accept "ff("hello",2)".
Exactly. Everywhere you see "auto" today, you'll see a concept name tomorro=
w (if approved). And I think the argument that you wouldn't want to write "=
auto foo( auto )" definitively evaporates once it's "Concept1 foo( Concept2=
x )", and that's the road we're on.
Of all the features proposed for C++17 or 20, I think it's already clear co=
ncepts will have the largest effect on the way we write new code. And I thi=
nk we don't yet quite grok just how broad that effect will be -- I expect m=
ost new function templates will routinely use them, but even more than that=
I suspect that five years from now many (though probably not most) new loc=
al variable declarations will likely be typed using concept names, and that=
right there is a lot of LOC. But the effect could be broader still, so it'=
s good we're going to start getting that experience.
Herb
> -----Original Message-----
> From: Bjarne Stroustrup [mailto:bjarne@stroustrup.com]
> Sent: Thursday, March 5, 2015 7:06 PM
> To: c++std-core@accu.org
> Cc: std-discussion@isocpp.org; std-proposals@isocpp.org;
> faisalv@gmail.com
> Subject: [c++std-core-27217] Re: An implementation of enhanced auto
> deduction and abbreviated template syntax using Clang
>=20
> (1) people always ask for heavier syntax from new features
> (2) people learn
> (3) people always complain that the syntax they insisted on is too heavy
> handed
>=20
> I remember serious and well-meaning criticism that allowing "sqrt(2)"
> would lead to misuse and bugs and that it was *good* for people and
> especially for maintenance if people had to write "sqrt(2.)" or
> "sqrt((double)2)" to avoid crashes.
>=20
> Yes, someone is going to write "void f(auto);" and be surprised. In parti=
cular,
> someone is going to write "void ff(auto,auto);" and be surprised that
> "ff("hello",2)" is allowed, but I think that ship has sailed. What we rea=
lly have
> to get into our/people's heads is that "auto" is just the weakest constra=
int.
> Even a concept that requires nothing is stronger because "void
> ff(Unconstrained, Unconstrained);"
> will not accept "ff("hello",2)". There are examples that are better expre=
ssed
> using the less terse notations. We will eventually settle on conventions =
for
> use.
--=20
---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-discussion+unsubscribe@isocpp.org.
To post to this group, send email to std-discussion@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-discuss=
ion/.
.