4 ms·
Looks useful! Pro tip, as a professional C/C++ dev, for macros: Wrap the body in a do-while loop, to force a semicolon after it’s called https://stackoverflow
by TheSoftwareGuy 6y ago
Looks useful!
Pro tip, as a professional C/C++ dev, for macros:
Wrap the body in a do-while loop, to force a semicolon after it’s called https://stackoverflow.com/questions/1067226/c-multi-line-macro-do-while0-vs-scope-block#1067238 https://stackoverflow.com/questions/1067226/c-multi-line-mac...
- account42 6y agoThat wouldn't work here (well it wouldn't without the return) as that would mean the break would apply to the loop and not the switch statement. In genereal, I think hiding control flow in macros is a bad idea.