Macros are obviously superior to functions in every possible way: - no runtime c...
Arseny Kapoulkine @zeux@mastodon.gamedev.place
Macros are obviously superior to functions in every possible way:
- no runtime cost
- no need to parse body until invocation
- no possibility of dangerous recursive calls
- can redefine or undefine to avoid symbol conflicts
- automatically adapts to argument types without expensive templates
- supports first class lamba expressions without ugly C++ lambda syntax
- promotes open source code
The only downside I can see is you need at least one function in your program: main() can’t be a macro :(