3 ms·
And if I want a vec(int *)? These token pasting 'generic' macros never work for non-trivial types.
by cv5005 1y ago
And if I want a vec(int *)?
These token pasting 'generic' macros never work for non-trivial types.
- teo_zero 1y agoCorrect, complex types must be typedef'd. At least, until c2y integrates _Record as per N3332: https://thephd.dev/_vendor/future_cxx/papers/C%20-%20_Record%20types.html https://thephd.dev/_vendor/future_cxx/papers/C%20-%20_Record...
- uecker 1y agoI am not terribly excited about this proposal. It is overly complex.
- teo_zero 1y agoI agree, but the current specification is complex too: two identical "tagged" structs are compatible, two identical "untagged" structs are not. And before C23 it was even worse, depending on whether the two structs were defined in the same file or not. We're applying a patch over a patch over a patch... no surprise the end result looks like a patchwork!
- uecker 1y agoSure, but _Record would add even more complexity. The tag rules I had changed in C23 were a step to remove complexity, so a step towards cleaning it up. I wasn't able to fix the untagged case, because WG14 had concerns, but I think these can be addressed, making another step. It is always much harder to undo complexity than to add it.