Deutsch English Français Italiano |
<v31icu$3v3ff$2@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: David Brown <david.brown@hesbynett.no> Newsgroups: comp.lang.c Subject: Re: C23 auto x C++ auto. Date: Mon, 27 May 2024 11:05:34 +0200 Organization: A noiseless patient Spider Lines: 24 Message-ID: <v31icu$3v3ff$2@dont-email.me> References: <v2vela$3e4pn$1@dont-email.me> <v2vgj3$3eh79$1@raubtier-asyl.eternal-september.org> <v2vmto$3ffl2$1@dont-email.me> <pan$4b490$fb350802$be410565$ed9732c3@invalid.invalid> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Mon, 27 May 2024 11:05:34 +0200 (CEST) Injection-Info: dont-email.me; posting-host="7989d793cb4f5bb8f14025e7e8038ebf"; logging-data="4165103"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Ug3wkrx3f+gjyQDBNXlobvkMVlfbpivo=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Cancel-Lock: sha1:IcwtfZTaEOLnaQRPZbYyR1HfpmU= Content-Language: en-GB In-Reply-To: <pan$4b490$fb350802$be410565$ed9732c3@invalid.invalid> Bytes: 2096 On 27/05/2024 07:55, Blue-Maned_Hawk wrote: > David Brown wrote: > >> It would have been nice to see statement expressions included in C23, as >> they have been in gcc for ages: >> >> #define max(a,b) \ >> ({ __auto_type _a = (a); \ >> __auto_type _b = (b); \ >> _a > _b ? _a : _b; }) > > As i understand it, WG14's plan is to eventually get lambdas into standard > C so as to unify statementexprs with Clang's Blocks and GCC's local > subroutines. > I've certainly seen suggestions for lambdas in C. I'm not sure that it is a great idea to add such high-level features to C - if we want to work in C but with lambdas, C++ already supports that. But "blocks" (borrowed from Objective-C, IIRC) are more advanced than gcc's statement expressions, so I suppose lambdas are a reasonable superset of these three extensions.