![]() |
micro-test-plus 3.2.2
µTest++ Testing Framework
|
Local implementation of source location information for diagnostics. More...
#include <micro-os-plus/micro-test-plus.h>
Public Member Functions | |
constexpr auto | file_name (void) const noexcept |
Retrieve the file name associated with this source location. | |
constexpr auto | line (void) const noexcept |
Retrieve the line number associated with this source location. |
Static Public Member Functions | |
static constexpr auto | current (const char *file="unknown", unsigned int line={}) noexcept |
Obtain the current source location. |
Private Attributes | |
const char * | file_ { "unknown" } |
The file name where the source location was captured. | |
unsigned int | line_ {} |
The line number where the source location was captured. |
This class provides a lightweight, constexpr-compatible alternative to std::source_location for environments lacking C++20 standard support.
It enables retrieval of the file name and line number at the point of invocation, supporting enhanced diagnostics and reporting within the µTest++ framework.
The static current() method captures the current source location, using compiler built-ins where available, or defaulting to "unknown" and zero otherwise.
Definition at line 136 of file reflection.h.
|
staticnodiscardconstexprnoexcept |
file | The file name (automatically provided by the compiler). |
line | The line number (automatically provided by the compiler). |
Returns a source_location instance representing the file name and line number at the point of invocation.
If supported by the compiler, uses built-in macros to capture this information; otherwise, defaults to "unknown" and zero.
Definition at line 91 of file reflection-inlines.h.
|
nodiscardconstexprnoexcept |
...
Definition at line 104 of file reflection-inlines.h.
|
nodiscardconstexprnoexcept |
...
Definition at line 114 of file reflection-inlines.h.
|
private |
Definition at line 180 of file reflection.h.
|
private |
Definition at line 185 of file reflection.h.