Comment by jkercher
12 hours ago
Yes and no. If you want to make something like a generic dynamic array, you can do it with type erasure (`void*`), but then your code is no longer typesafe. I would find that more fragile. The preprocessor allows you to add constructs that make it behave like any other modern language.
As an aside, clangd can dereference a macro in place to make debugging easy.
You're usually better off just using realloc, or an abort-on-oom wraper of it, in my experience.
And for generic data structures one can also a very thin layer of macros around type-erased implementations.