std::experimental::source_location (3) - Linux Manuals
std::experimental::source_location: std::experimental::source_location
NAME
std::experimental::source_location - std::experimental::source_location
Synopsis
Defined in header <experimental/source_location>
struct source_location; (library fundamentals TS v2)
The source_location class represents certain information about the source code, such as file names, line numbers, and function names. Previously, functions that desire to obtain this information about the call site (for logging, testing, or debugging purposes) must use function-style macros so that predefined macros like __LINE__ and __FILE__ are expanded in the context of the caller. The source_location class provides a better alternative.
Member functions
Creation
constructor (public member function)
current constructs a new source_location
[static]
Other special member functions
destructor destructs a source_location
(implicitly declared)
operator= Implicitly declared copy/move assignment operators
(implicitly declared)
Field access
line (public member function)
column (public member function)
file_name (public member function)
function_name (public member function)
Example
// Run this code
Possible output: