Add a context to the result returned from the annotated function, regardless of return path.
This is most useful when there are multiple error points in a function, and annotating the context of the function at each point adds too much noise.
Format
You can call [std::format] to include function arguments in the message.
Note: that the format string is eagerly created at the beginning of the function. There currently isn't a way around this, as arguments to the function may be moved.
Works with
The annotation works with:
- Async functions
- Functions in impl blocks