3 ms·
Officially adopting __auto_type as auto is good. Unfortunate that N2953 dropped function return type and parameters. This feature composes with _Generic macros
by xenadu02 3y ago
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.