How to find the name of the current function at runtime?
Your macro can contain the __FUNCTION__ macro. Make no mistake, the function name will be inserted into the expanded code at compile time, but it will be the correct function name for each call to your macro. So it “seems like” it happens in run-time 😉 e.g. #define THROW_IF(val) if (val) throw “error in ” … Read more