To make macros more usable.
Macros are really nice tools to template classes and later change them globally, but the lack of support from visual studio discourages it's usage. Let the developer to debug macros, let the macro expand to actual code if developer wants so. This is essential part of c++ language, it is a very bad idea to ignore it. Give at least some attention to macros and let debug it, if code expansion would be too much.
2 comments
-
John M. Długosz
commented
/it's/its/
-
Dave Novak
commented
You could probably accomplish this same goal by using C++ templates. Burying too much code in a macro is never a good thing . . . for the reasons you describe.
Something else you can look into is selecting the compiler option Preprocess to a File (/P), in the Preprocessor section. This generates a <filename>.i file with all macros fully expanded, which you can rename to something like <filename>2.cpp, add to your project, and then compile and debug.