-
Notifications
You must be signed in to change notification settings - Fork 92
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
Regression: serializing vector<> of objects #967
Comments
There are multiple things going on here. First of all, your vector<any_result> v;
boost::json::value jv;
tag_invoke(boost::json::value_from_tag(), jv, v); choosing your The second thing is that If you want the previous behaviour
|
Correction: the "second thing" is only applicable to version 1.84.0, in which your test would produce |
If making struct any_result_arg
{
any_result const& r;
any_result_arg(any_result const& r) : r(r) {}
};
void
tag_invoke(boost::json::value_from_tag, boost::json::value& jv, any_result_arg const& arg)
{
arg.r.value_from(jv);
}
|
Yet another version: template< class T >
typename std::enable_if< std::is_same<T, any_result>::value >::type
tag_invoke(
boost::json::value_from_tag, boost::json::value& jv, const T& r)
{
r.value_from(jv);
} |
Hello,
I've found that the behavior of the following code snipped is different for different boost versions.
Version of Boost
I believe that 1.75.0 behavior should be correct here.
Steps necessary to reproduce the problem
All relevant compiler information
gcc 9--13 have been tested on Wandbox.
The text was updated successfully, but these errors were encountered: