The C++ macro __FILE__ typically includes the full path (with many compilers).
For my tracing, I want just the file name, not the full path.
Is there a built-in macro for this in any version of C++ or do I have to write my own?
This is not quite a duplicate of __FILE__ macro shows full path. That question is targeted at the 'C' language, and answers to that question which are C++ are actually incorrect for that question. This question is targeted specifically at C++.
__LINE__and__FUNCTION__which they're used to and then [new macro] which looks the same. For the curious, they may not think that macro existed, but they can then find out that it's implemented in the code.c++ foo.cppthe__FILE__is foo.cpp. Butc++ /home/eljay/proj/foo.cppthe__FILE__is /home/eljay/proj/foo.cpp.