DEV Community

Discussion on: Help fix my bloated C++ macros!

Collapse
 
mortoray profile image
edA‑qa mort‑ora‑y

I've pushed a lot into functions already. I need to get the calling location though, so I have to get access to LINE and FILE somehow. That, along with the other boilerplate I don't really want to repeat.

The conditional expansion of the logged values is an essential must as well. The rules on eliminating expressions are simply not good enough that I'll avoid the expensive creation (the optimizer just won't know there are no side-effects in the called function unfortunately).