2 ms·
The "interface" would directly expose the specialized and uniquely named functions. _Generic is just an inline helper to automatically select the right speciali
by flohofwoe 2y ago
The "interface" would directly expose the specialized and uniquely named functions. _Generic is just an inline helper to automatically select the right specialized function by a type. If C ABI compatibility is required, that's about the only way to do it (for better or worse).
(FWIW I haven't found a compelling reason yet to use _Generic in my own C code)
- ori_b 2y agoI don't think there are very many compelling reasons to use it. It's a dead end. If I can use _Generic, I can get a cleaner interface by directly calling the right function, and skipping the macro mess.