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.
Compiler Explorer link: https://compiler-explorer.com/z/M713vnW6f