I.10 "Use exceptions..." doesn't mention [[nodiscard]] alternative
The reason as stated in I.10: Use exceptions to signal a failure to perform a required task is as follows:
Reason It should not be possible to ignore an error because that could leave the system or a computation in an undefined (or unexpected) state. This is a major source of errors.
There's another rule that satisfies the statement above, namely: Always use a type marked as [[nodiscard]] such as absl::Status or absl::StatusOr to signal a failure to perform a required task
Could you expand I.10 to explain why exceptions are preferable to this approach?
Link for convenience: https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#i10-use-exceptions-to-signal-a-failure-to-perform-a-required-task And Status/StatusOr documentation: https://abseil.io/docs/cpp/guides/status
I.10 makes a distinction between failing and returning a status (..."to report what are really status codes, rather than errors.").
Non-ignorable status codes are pretty cool though, and could have a mention here where it talks about "consider using a style that returns a pair of values" or in E.27: If you can’t throw exceptions, use error codes systematically