3 ms·
It depends. What if "f" is macro?
by CoastalCoder 4y ago
It depends. What if "f" is macro?
- dragontamer 4y agoDepends. What if someone wrote "#define if while" and the word "if" is a macro? // In #include<deep/deep/deep/include.h> #define if while // somewhere else if(1){ puts("Help, I'm stuck in an infinite loop!"); } There's a reason why macros should be all-caps when used, and IMO, C++ programmers should prefer templates. Macros are too powerful, and need to be used extremely cautiously in my experience. Pointing out that macros can totally mess up your expectations isn't exactly news to anybody who does C/C++ programming.
- bodhiandphysics 4y agoReally if I’m programming c++ I avoid macros (except if guards). Though I do have the advantage that my code doesn’t need to be portable