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
Boost version 1.78.0
The shortest reproduction is:
#include <boost/system/result.hpp> static_assert(boost::system::result<int>{boost::system::errc::invalid_argument}.has_error());
<source>:511:90: error: static assertion failed 511 | static_assert(boost::system::result<int>{boost::system::errc::invalid_argument}.has_error()); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~ Compiler returned: 1
I use similar pattern extensively in the code with outcome and std::error_code , something like:
std::error_code
result<int> do_something(int count) { if (count < 0) return std::errc::invalid_argument; }
The fact that errc enum converts to value implicitly is really surprising (won't be surprised if it just didn't convert).
errc
The text was updated successfully, but these errors were encountered:
Add negative test for constructing result<int> from errc_t (refs #74)
8c9ceba
A better fix for this would be making errc_t a scoped enum (#75), but for now, I'll disable the conversions to int on the result side.
errc_t
int
result
Sorry, something went wrong.
01ce081
No branches or pull requests
Boost version 1.78.0
The shortest reproduction is:
I use similar pattern extensively in the code with outcome and
std::error_code
, something like:The fact that
errc
enum converts to value implicitly is really surprising (won't be surprised if it just didn't convert).The text was updated successfully, but these errors were encountered: