Utility class to emulates std::source_location class introduced in c++20 This class provides information about the source location where it is used.
More...
#include <shambase/include/shambase/cxxbackports/source_location.hpp>
|
| constexpr unsigned | line () const noexcept |
| | Returns the line number of the source location.
|
| |
| constexpr unsigned | column () const noexcept |
| | Returns the column offset of the source location.
|
| |
| constexpr const char * | file_name () const noexcept |
| | Returns the file name of the source location.
|
| |
| constexpr const char * | function_name () const noexcept |
| | Returns the function name of the source location.
|
| |
|
| static constexpr source_location | current () noexcept |
| | Returns the source location where this function is called.
|
| |
Utility class to emulates std::source_location class introduced in c++20 This class provides information about the source location where it is used.
- See also
- https://en.cppreference.com/w/cpp/utility/source_location
Example of usage :
std::cout << "file: "
<< location.file_name() << '('
<< location.line() << ':'
<< location.column() << ") `"
<< location.function_name() << '\n';
}
Utility class to emulates std::source_location class introduced in c++20 This class provides informat...
static constexpr source_location current() noexcept
Returns the source location where this function is called.
Definition at line 87 of file source_location.hpp.
◆ column()
| std::source_location::column |
( |
| ) |
const |
|
constexprnoexcept |
Returns the column offset of the source location.
- Returns
- The column offset.
◆ current()
| std::source_location::current |
( |
| ) |
|
|
staticconstexprnoexcept |
Returns the source location where this function is called.
- Returns
- The source location.
◆ file_name()
| std::source_location::file_name |
( |
| ) |
const |
|
constexprnoexcept |
Returns the file name of the source location.
- Returns
- The file name.
◆ function_name()
| std::source_location::function_name |
( |
| ) |
const |
|
constexprnoexcept |
Returns the function name of the source location.
- Returns
- The function name.
◆ line()
| std::source_location::line |
( |
| ) |
const |
|
constexprnoexcept |
Returns the line number of the source location.
- Returns
- The line number.
The documentation for this class was generated from the following file: