Appends the loc to the current location chain inside the status iff the status is non-ok and contains a non-empty message, and returns an rvalue reference to *this.
Declared in <absl/status/status.h>
[[nodiscard]]
Status&&
WithSourceLocation(absl::SourceLocation loc = absl::SourceLocation::current()) &&;
Example:
Status Finalize(...);
Status DoSomething(...) { ... return Finalize().WithSourceLocation(); }
| Name | Description |
|---|---|
| loc | The source location to append. |