3 ms·
This is like template metaprogramming :) You're confusing the difference between macros and functions, only functions fully avoid duplication (except when they
by layla5alive 2y ago
This is like template metaprogramming :)
You're confusing the difference between macros and functions, only functions fully avoid duplication (except when they are inlined!)
Macros are expanded into text by the preprocessor. Templates are expanded by the compiler instead.
- kevindamm 2y agoReal macros (lisp-style not C-style) are more like template metaprogramming, too. It's not clear which source language GP comment is referring to.
- ngcc_hk 2y agoActually c++ later seems to evolve a similar way : see part 2 of 4 of this series : https://deque.blog/2017/05/09/lisp-meta-programming-for-c-developers-first-macros/ https://deque.blog/2017/05/09/lisp-meta-programming-for-c-de...