Re: C23 auto x C++ auto.

Liste des GroupesRevenir à l c 
Sujet : Re: C23 auto x C++ auto.
De : Bonita.Montero (at) *nospam* gmail.com (Bonita Montero)
Groupes : comp.lang.c
Date : 26. May 2024, 18:13:20
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v2vn2v$3fiqr$1@raubtier-asyl.eternal-september.org>
References : 1 2 3
User-Agent : Mozilla Thunderbird
Am 26.05.2024 um 18:10 schrieb David Brown:

"typeof" and "auto" have been available forever as gcc extensions (where "auto" was spelt "__auto_type", since of course "auto" had another meaning in C until C23).  One use-case for C is in macros that handle multiple types, but I expect people have done other things with them too.
 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; })
  In general, it's just another tool that could be useful in writing code that's a bit more flexible.
 
Generic programming in C is sick.

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