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.