3 ms·
No, you can do this sort of madness in C too via function pointer tables. Give the function pointer field in your struct a commonly-grep-spammed name like "clo
by ajross 13y ago
No, you can do this sort of madness in C too via function pointer tables. Give the function pointer field in your struct a commonly-grep-spammed name like "close" and watch your readers go mad trying to figure out what xxx->close() does.
- Peaker 13y agoVirtual tables are not quite the same thing. You can grep for every instantiation of the struct in the code-base. If anything, macros are more problematic: #define VTABLE_INIT(prefix) \ (struct vtable){ .add = &prefix##_add, .sub = &prefix##_sub, and so forth }