|
| | Diagnostic (const char *message, const char *file=__builtin_FILE(), int line=__builtin_LINE(), const char *function=__builtin_FUNCTION()) |
| | Wrap a message, capturing the caller's source location by default.
|
| |
| | Diagnostic (std::string message, const char *file=__builtin_FILE(), int line=__builtin_LINE(), const char *function=__builtin_FUNCTION()) |
| | Wrap a message, capturing the caller's source location by default.
|
| |
| const std::string & | message () const noexcept |
| | The diagnostic message.
|
| |
| const SourceLocation & | location () const noexcept |
| | The source location captured when the Diagnostic was constructed.
|
| |
A diagnostic message bundled with the source location where it was written.
The core helpers (raise(), check(), throw_if(), check_not_null()) take a Diagnostic in place of an explicit source location. Its file/line/function arguments default to the compiler builtins __builtin_FILE()/__builtin_LINE()/ __builtin_FUNCTION(), which capture the caller's location, so a string literal or std::string passed at the call site is implicitly wrapped into a Diagnostic that records exactly where the call appears – callers pass no explicit location:
svmp::check<MyException>(ptr != nullptr, "pointer must not be null");