Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That's why in C++ people seem to generally recommend inline functions instead. Not only do the arguments only get evaluated once, but the whole thing is type safe too.

Of course, people still misuse macros.



Macros, by definition, are always misused, complete the languages point of view. They exist to let the programmer get the job done when the language falls short.


Well, I would define misuse as using them when the language doesn't fall short, like for the max example.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: