News for hackers. Stuff that matters.
Re:GCC 13 Supports New C2x Features, Including Nullptr, Enha... by xenadu02 on Monday May 15, 2023 @07:45PM (#35956072)
Officially adopting __auto_type as auto is good. Unfortunate that N2953 dropped function return type and parameters.

This feature composes with _Generic macros quite well:

  #define div(X,Y) _Generic((X)+(Y), int: div, long: ldiv, long long: lldiv) ((X), (Y))
  
  auto res = div(38484848448, 448484844); 
  auto a = b * res.quot + res.rem;

It also lets you get rid of all the "typeof(X)" foo in macro definitions.

There are no comments on this comment yet.