-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
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
Non-throwing conversions for Eigen::Matrix4d #843
Comments
|
|
It doesn't seem to work when I use the actual Eigen matrix, though. https://godbolt.org/z/9n9xY33Pn :-) I'll open an issue in Boost.System about that. The reason for it not working is that the Eigen matrix has a constructor taking any |
Indeed, Eigen does tend to be complex to deal with.
|
This is a manifestation of the same issue. It will be fixed in the next release, but in the meantime, you can work around it by explicitly requesting error construction of the result by replacing This also works for the |
Thanks for the workaround, appreciated.
|
You are welcome. Note that your previous
was actually better, because it added a source location to the returned error code. If you later print See e.g. https://godbolt.org/z/76a631Pfo. You're not required to use |
(And if you want both custom error codes and source locations, https://godbolt.org/z/vf38enaPd.) |
Happy to close this issue now, thanks for the advice. |
Wait, this issue should be closed now, right @nigels-com ? |
Yes, I think so. Thanks. |
Boost 1.81.0
Visual C++ 2019 (64-bit)
I'm trying to follow the documentation for using the
tag_invoke
method of adding support for Eigen dense matrix types.I've managed to get things working including appropriate error checking, but lacking confidence that I'm doing it the intended or correct way. The
ip_address
example discussed in the documentation uses:return make_error_code( std::errc::invalid_argument );
which is resulting in a compilation error for me:There isn't much documentation of
boost::json::result_for
(or relevant links) butresult_from_errno
does seem to work.In particular it seems unfortunate to collect the
error_code ec
for theto_number<double>()
and not have a way to set that error as the result.Is the documentation just a bit stale w.r.t boost 1.81.0? Am I missing something obvious? Tell me I'm doing it wrong. :)
The text was updated successfully, but these errors were encountered: