In Herb Sutter's cppcon talk, he stated (again) that they have ambitions to get rid of macros entirely and replace it with modern C++ stuff.
I am using the following macro for logging in printf-style (will most likely change to fmtlib, though) and I am wondering, how to get rid of macros in that case.
#define LOG_INFO(...) do { printf("INFO: "); printf(__VA_ARGS__); printf(" | file[%s] line[%d]\n", __FILE__, __LINE__); } while(0)
I don't see how this could be done without macros because of __FILE__
and __LINE__
alone. But I'm also not aware of any replacement for __VA_ARGS__
. Does such a thing exist?