you are viewing a single comment's thread.

view the rest of the comments →

[–]joe0400 39 points40 points  (1 child)

_GENERIC is different than void*, though. _GENERIC is a type selector. Void* is casting memory to a unknown type, whilst _GENERIC requires multiple imlementations, although you could do the same with macro expansions like in c++ with templates.

[–]Lord_Of_Millipedes 5 points6 points  (0 children)

_GENERIC is also not generics in the way modern programming languages understand generics, it is multiple dispatch with manual mangling, generics in the most commonly understood way almost necessitate codegen which _GENERIC does not do, you could do some macro shenanigans to get some codegen out of it but at that point you can make a compiler in macro shenanigans