rm5248 commented on a change in pull request #95: URL: https://github.com/apache/logging-log4cxx/pull/95#discussion_r778442479
########## File path: src/main/include/log4cxx/spi/location/locationinfo.h ########## @@ -132,9 +152,28 @@ class LOG4CXX_EXPORT LocationInfo #if !defined(__LOG4CXX_FUNC__) #define __LOG4CXX_FUNC__ "" #endif + +#if __cpp_lib_string_view || (_MSVC_LANG >= 201703L) +#include <string_view> + +#define LOG4CXX_LOCATION_CREATE ::std::string_view file_name{__FILE__};\ Review comment: Yes, I like your idea of a separate function, that makes it much cleaner. I was trying to avoid expanding __FILE__ multiple times, until I remembered that the compiler will only put in the same string once into the binary. That also makes it easier to support both versions: one using `string_view` and the fallback using `strrchr`. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@logging.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org