In my opinion, never. Macros are text substitution tools that work at the compiler level, not when executing code. This is useful for determining constants, etc., but not for more complex things.
Functional macros seem to be used when there are a lot of repetitions in the code, so you do not need to support the same procedure in 13 different places. However, if you can successfully use the macro in this way, your code is poorly organized - you will most likely be better off reorganizing it and creating a single method for its implementation.
source share