Daily bit(e) of C++ | std::source_location
Daily bit(e) of C++ #235, The C++20 utility for obtaining source location information: std::source_location.
Before C++20, obtaining information about the source code location (line, file, function) required reliance on (sometimes non-portable) macros.
The std::source_location is a small C++20 utility that encapsulates source code location information in a C++ class. Note that the returned values are still implementation-defined.