#include <source_location.h>
The SourceLocation
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 macros so that predefined macros like __LINE__
and __FILE__
are expanded in the context of the caller. The SourceLocation
class provides a better alternative.
based on: https://en.cppreference.com/w/cpp/utility/source_location
◆ SourceLocation() [1/3]
constexpr stx::SourceLocation::SourceLocation |
( |
| ) |
|
|
inlinenoexcept |
◆ SourceLocation() [2/3]
constexpr stx::SourceLocation::SourceLocation |
( |
SourceLocation const & |
other | ) |
|
|
defaultnoexcept |
◆ SourceLocation() [3/3]
constexpr stx::SourceLocation::SourceLocation |
( |
SourceLocation && |
other | ) |
|
|
defaultnoexcept |
◆ ~SourceLocation()
stx::SourceLocation::~SourceLocation |
( |
| ) |
|
|
defaultnoexcept |
◆ column()
constexpr uint_least32_t stx::SourceLocation::column |
( |
| ) |
const |
|
inlinenoexcept |
return the column number represented by this object
◆ current()
static constexpr SourceLocation stx::SourceLocation::current |
( |
const char * |
file = "unknown" , |
|
|
const char * |
func = "unknown" , |
|
|
uint_least32_t |
line = 0 , |
|
|
uint_least32_t |
column = 0 |
|
) |
| |
|
inlinestaticnoexcept |
◆ file_name()
constexpr const char* stx::SourceLocation::file_name |
( |
| ) |
const |
|
inlinenoexcept |
return the file name represented by this object
◆ function_name()
constexpr const char* stx::SourceLocation::function_name |
( |
| ) |
const |
|
inlinenoexcept |
return the name of the function represented by this object, if any
◆ line()
constexpr uint_least32_t stx::SourceLocation::line |
( |
| ) |
const |
|
inlinenoexcept |
return the line number represented by this object
◆ operator=() [1/2]
◆ operator=() [2/2]
The documentation for this struct was generated from the following file: