We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tl::make_unexpected()
[[nodiscard]]
As the titles says, the function tl::make_unexpected() should be marked [[nodiscard]].
It would prevent misuse when forgetting to return the unexpected value:
enum class ErrorType{ kNullParameter }; struct ResultType{}; tl::expected<ResultType, ErrorType> myFunction(int nonNullParameter) { if(nonNullParameter== 0) { tl::make_unexpected(ErrorType::kNullParameter); } return ResultType{}; }
Here I forgot to return the unexpected value and there's no warning whatsoever.
The text was updated successfully, but these errors were encountered:
tl::make_unexpected
No branches or pull requests
As the titles says, the function
tl::make_unexpected()
should be marked[[nodiscard]]
.It would prevent misuse when forgetting to return the unexpected value:
Here I forgot to return the unexpected value and there's no warning whatsoever.
The text was updated successfully, but these errors were encountered: