This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Nested-Functions
- From: Alexsandr Yvarov <a dot yvarov at yandex dot ru>
- To: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- Cc: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Fri, 05 Jan 2018 13:09:43 +0700
- Subject: Re: Nested-Functions
- Authentication-results: sourceware.org; auth=none
- Authentication-results: mxback19j.mail.yandex.net; dkim=pass header.i=@yandex.ru
- Envelope-from: a-yvarov at yandex dot ru
- References: <2834421515014004@web57j.yandex.ru> <CAH6eHdS=GLMrZgn1Z9va3MqgSBUQsW8TjEenL+iqe9Tt1PbtjQ@mail.gmail.com>
Thanks Jonathan!
Hm... why would don't add it for portability? Of course, i don't see codes with Nested-Functions so much, but...
I think that better would delete it, or add full support?
And, it's contradicts to standart of C, nope?:)
~~~~~~~~~~~
About lambda:
Yeah is very pooowerful, of course. Is true.
#include<iostream>
void fcn(int n=100){
int i;
auto f = [&i,n]{ i=n; };
f();
std::cout << i << ":" << n << std::endl;
}
int main(void){
fcn();
}
||
#include<stdio.h>
void fcn(void){
int i;
void ofcn(void){
i=100;
}
ofcn();
printf("%d\n",i);
}
int main(void){
fcn();
}
04.01.2018, 06:05, "Jonathan Wakely" <jwakely.gcc@gmail.com>:
> On 3 January 2018 at 21:13, Alexsandr Yvarov wrote:
>> Why would dont add it at GNU G++?
>
> Aren't C++ lambda expressions more powerful and flexible?