5 ms·
No. You don't mess around with the language like that. This is how you do it: https://github.com/codr7/hacktical-c/tree/main/vector https://github.com/codr7/h
by codr7 11mo ago
No.
You don't mess around with the language like that.
This is how you do it:
https://github.com/codr7/hacktical-c/tree/main/vector https://github.com/codr7/hacktical-c/tree/main/vector
- xigoi 11mo agoThis is the type erasure approach, whose cons are mentioned in the article.
- codr7 11mo agoIt's the C approach, strong typing doesn't mix well with raw memory access.
- xigoi 11mo agoNim is strongly typed and allows raw memory access just fine.
- deleted 11mo ago[deleted]
- 1718627440 11mo agoThe very article we are discussing shows you a way how to do that type safely in C. It uses #include which is a very idiomatic way to do this in C, and an example where a preprocessor-based approach is more flexible, than e.g. a module system.