Topic: [std-proposals] An implementation of
Author: Andrea Proli <andy.prowl@gmail.com>
Date: Sat, 12 Jan 2013 13:05:15 +0100
Raw View
--f46d04428f8a90b71104d3163900
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Well, if an exceptional rule is to be added, then it means it does conflict
with 14/2 :) but I see what you mean.
On Sat, Jan 12, 2013 at 12:52 PM, Daniel Kr=FCgler
<daniel.kruegler@gmail.com>wrote:
> 2013/1/12 Andrea Proli <andy.prowl@gmail.com>:
> > I was used to think of lambdas as syntactic sugar, but *generic* lambda=
s
> are
> > not: the generated closure breaks the rule from paragraph 14/2:
> >
> > "A template-declaration can appear only as a namespace scope or class
> scope
> > declaration".
> >
> > I am unaware of the reasons why this restriction exists in the first
> place
> > (I did some research but with no success), so I cannot write a proposal
> on
> > lifting it. However, if good reasons exist, I am curious whether the fa=
ct
> > that generic lambdas break it will create troubles.
>
> Polymorphic (or generic, if you prefer) lambda expressions don't
> provide the full capacities of templates. As you say, they just are
> syntactic sugar for some sub-space of possible template constructions.
> It is therefore much simpler to add them compared to starting with a
> support for local templates from begin with. This would not
> necessarily result in a conflict with 14/2, you just add one
> exceptional rule and that's it.
>
> - Daniel
>
> --
>
>
>
>
--=20
--f46d04428f8a90b71104d3163900
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Well, if an exceptional rule is to be added, then it means it does conflict=
with 14/2 :) but I see what you mean.<br><br><div class=3D"gmail_quote">On=
Sat, Jan 12, 2013 at 12:52 PM, Daniel Kr=FCgler <span dir=3D"ltr"><<a h=
ref=3D"mailto:daniel.kruegler@gmail.com" target=3D"_blank">daniel.kruegler@=
gmail.com</a>></span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">2013/1/12 Andrea Proli <<a href=3D"mailto=
:andy.prowl@gmail.com">andy.prowl@gmail.com</a>>:<br>
<div class=3D"im">> I was used to think of lambdas as syntactic sugar, b=
ut *generic* lambdas are<br>
> not: the generated closure breaks the rule from paragraph 14/2:<br>
><br>
> "A template-declaration can appear only as a namespace scope or c=
lass scope<br>
> declaration".<br>
><br>
> I am unaware of the reasons why this restriction exists in the first p=
lace<br>
> (I did some research but with no success), so I cannot write a proposa=
l on<br>
> lifting it. However, if good reasons exist, I am curious whether the f=
act<br>
> that generic lambdas break it will create troubles.<br>
<br>
</div>Polymorphic (or generic, if you prefer) lambda expressions don't<=
br>
provide the full capacities of templates. As you say, they just are<br>
syntactic sugar for some sub-space of possible template constructions.<br>
It is therefore much simpler to add them compared to starting with a<br>
support for local templates from begin with. This would not<br>
necessarily result in a conflict with 14/2, you just add one<br>
exceptional rule and that's it.<br>
<span class=3D"HOEnZb"><font color=3D"#888888"><br>
- Daniel<br>
<br>
--<br>
<br>
<br>
<br>
</font></span></blockquote></div><br>
<p></p>
-- <br />
<br />
<br />
<br />
--f46d04428f8a90b71104d3163900--
.
Author: =?ISO-8859-1?Q?Daniel_Kr=FCgler?= <daniel.kruegler@gmail.com>
Date: Sat, 12 Jan 2013 13:33:09 +0100
Raw View
2013/1/12 Andrea Proli <andy.prowl@gmail.com>:
> Well, if an exceptional rule is to be added, then it means it does conflict
> with 14/2 :) but I see what you mean.
Well, I described it as "exceptional" rule, but there doesn't need to
exist such normative sentence. It all depends on the actual wording
for polymorphic lambdas whether such a sentence is needed. If the
language specifies polymorphic lambda expressions and if it is clear
that this includes local scope, there is no extra wording needed. You
could add a non-normative note to the general exclusion rule, just as
another example.
- Daniel
--
.
Author: Ville Voutilainen <ville.voutilainen@gmail.com>
Date: Wed, 4 Mar 2015 14:49:02 +0200
Raw View
On 4 March 2015 at 14:45, Faisal Vali <faisalv@gmail.com> wrote:
>> I don't see the use-case for this feature. Why would I write
>>
>> vector<auto> v = vector<int>();
>>
>> when it's less typing and less noise to just write
>>
>> auto v = vector<int>();
>>
> I generally agree with the above statement - but there are some who
> have argued that it can improve readability - and I see their point
> too.
That's a bad example for it. A better one is
vector<auto> v = some_function();
where you don't care about the exact return type of some_function,
but you do want to ensure it's a vector. Such ensuring is indeed completely
unnecessary for the example above where the type created is visible
in a crystal clear fashion.
--
---
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 email 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-discussion/.
.
Author: =?UTF-8?Q?Klaim_=2D_Jo=C3=ABl_Lamotte?= <mjklaim@gmail.com>
Date: Fri, 6 Mar 2015 00:53:56 +0100
Raw View
--001a113fc1ecf6959f0510934730
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
=E2=80=8BI don't see the point in adding such requirement for people who do=
n't
consider it a problem
(me included). My understanding is that the proposal provide several ways
to say aproximatively
the same thing and you can easily chose the level of details that suits
your viewpoint.
I think it's better that way.
--=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/.
--001a113fc1ecf6959f0510934730
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br>=E2=80=8BI don't see the point in adding such requ=
irement for people who don't consider it a problem<div>(me included). M=
y understanding is that the proposal provide several ways to say aproximati=
vely</div><div>the same thing and you can easily chose the level of details=
that suits your viewpoint.</div><div>I think it's better that way.</di=
v></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Discussion" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-discussion+unsubscribe@isocpp.org">std-discus=
sion+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-discussion@isocp=
p.org">std-discussion@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-discussion/">http://groups.google.com/a/isocpp.org/group/std-discussion=
/</a>.<br />
--001a113fc1ecf6959f0510934730--
.