SysTutorials

Linux Manual Pages › Section 3

stdexperimentalsource_locationcurrent(3)

std::experimental::source_location::current - std::experimental::source_location::current

Synopsis

static constexpr source_location current() noexcept;  (library fundamentals TS v2)

Constructs a new source_location object.

Return value

If current() is invoked directly (via a function call that names current()), it returns a source_location object with implementation-defined values representing the location of the call. The values should be affected by the #line_preprocessor_directive in the same manner as the predefined macros LINE and FILE. If current() is invoked in any other manner, the return value is unspecified. Remarks If current() is used in an initializer_for_a_non-static_data_member, the return value corresponds to the location of the constructor or aggregate_initialization that initializes the data member.

Notes

When current() is used in a default argument, the return value will correspond to the location of the call to current() at the call site.

Parameters

(none)

See also

              constructs a new source_location with implementation-defined values constructor (public member function)