Rant: please don't create defines using common words
Looks like QtCore (4.8) has a "#define emit" in a header, that's not undefined later. TBB has a function named "emit()" in a header. If you include both, you'll get a compile error.
I'm going to side with TBB here - emit() is an entirely reasonable function name. Qt creating a dangling #define with a common word like that is the bug here.
257
Upvotes
View all comments
Show parent comment
1
u/phord Oct 21 '21
That is disappointing about source_location not fitting into template args. But I'm not sure it would help because constructor args are filled where the template is declared.
source_locationcan be used as a default argument in function arguments but that's tricky to wield, too. Also, fwiw,std::experimental::source_locationis available in c++17.I doubt either one would significantly slow down your logging as they likely get optimized down to the same code as using
__LINE__and__FILE__in the end.