Re: C23 auto x C++ auto.

Liste des GroupesRevenir à cl c  
Sujet : Re: C23 auto x C++ auto.
De : david.brown (at) *nospam* hesbynett.no (David Brown)
Groupes : comp.lang.c
Date : 27. May 2024, 11:05:34
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v31icu$3v3ff$2@dont-email.me>
References : 1 2 3 4
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0
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.

Date Sujet#  Auteur
26 May 24 * C23 auto x C++ auto.16Thiago Adams
26 May 24 +* Re: C23 auto x C++ auto.11Bonita Montero
26 May 24 i+* Re: C23 auto x C++ auto.8David Brown
26 May 24 ii+- Re: C23 auto x C++ auto.1Bonita Montero
26 May 24 ii+* Re: C23 auto x C++ auto.3Thiago Adams
27 May 24 iii+- Re: C23 auto x C++ auto.1David Brown
7 Jun 24 iii`- Re: C23 auto x C++ auto.1Lawrence D'Oliveiro
27 May 24 ii`* Re: C23 auto x C++ auto.3Blue-Maned_Hawk
27 May 24 ii `* Re: C23 auto x C++ auto.2David Brown
7 Jun 24 ii  `- Re: C23 auto x C++ auto.1Lawrence D'Oliveiro
27 May 24 i`* Re: C23 auto x C++ auto.2Blue-Maned_Hawk
27 May 24 i `- Re: C23 auto x C++ auto.1Bonita Montero
26 May 24 +* Re: C23 auto x C++ auto.3Michael S
26 May 24 i`* Re: C23 auto x C++ auto.2Thiago Adams
26 May 24 i `- Re: C23 auto x C++ auto.1Thiago Adams
27 May 24 `- Different languages (off-topic in CLC) (Was: C23 auto x C++ auto.)1Kenny McCormack

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal