@paula @maija @snacks false. C23 already has structural typing (as well as typeof and auto) which allows you to effectively have generics using macros, meaning you can do tuples like:
#include <stdio.h> #define tuple(A,B) struct tuple_##A##_##B { A fst; B snd; } tuple(int, char) silly_function() { return (tuple(int, char)) { 25, 'a' }; } int main() { auto x = silly_function(); printf("(%d, %c)\n", x.fst, x.snd); }however this is limited so far, basically structs with the same name and fields are compatible, and because of that you can only pass in types that can be properly concatenated into the name into there. (e.g. can’t have pointers in there without making a typedef for them, which is annoying). C2y will add record types which solve this problem.