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
Version of Boost 1.84.0
Code:
class X { public: X() : x(false) {} X(bool x) : x(x) {} protected: bool x; BOOST_DESCRIBE_CLASS(X, (), (), (x), ()) }; int main() { try { boost::json::value jv = { { "x", 0 } }; auto a = boost::json::value_to<X>(jv); } catch (std::exception const& e) { std::cerr << "Error: " << e.what() << std::endl; } }
This would faild and throw an exception: Error: value is not boolean
The text was updated successfully, but these errors were encountered:
Yes. This is by design. 0 is not a boolean value.
Sorry, something went wrong.
No branches or pull requests
Version of Boost
1.84.0
Code:
This would faild and throw an exception: Error: value is not boolean
The text was updated successfully, but these errors were encountered: