##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# std::experimental::source_location

From cppreference.com
< cpp‎ | experimental

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.

### [edit] Member functions

##### Creation
(constructor) | constructs a new `source_location` with implementation-defined values (public member function) [edit]
current [static] | constructs a new `source_location` (public static member function) [edit]
##### Other special member functions
(destructor) (implicitly declared) | destructs an `source_location` (public member function) [edit]
operator= (implicitly declared) | Implicitly declared copy/move assignment operators (public member function) [edit]
##### Field access
line | return the line number represented by this object (public member function) [edit]
column | return the column number represented by this object (public member function) [edit]
file_name | return the file name represented by this object (public member function) [edit]
function_name | return the name of the function represented by this object, if any (public member function) [edit]

### [edit] Example

| This section is incomplete Reason: no example

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=cpp/experimental/source_location&oldid=79485"
Category:

- Todo no example