-
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
Add a convenience member function to call value_to #983
Comments
You can still use Describe if you declare an intermediate struct holding the parameters. |
On second thought, isn't
possible to write today as
? |
It is. I think, @kiwixz considers that syntax too cumbersome. To be honest, I'm not fond of adding just another way to call |
I didn't think of It still feels weird to me to use it as a free function, especially when we have |
True, but making an equivalent of |
Hi, first of all thanks for the great library fast yet easy to use.
I'm currently writing tag_invoke functions to convert JSON values from/to a class, and I have something like this:
It's a class with private values and a constructor, so I cant just rely on Boost Describe for this.
If there was a
to<T>()
member function (just callingboost::json::value_to
under the hood), I could have arguably more consistent code:And it could also allow something ever better (to my eyes that is!):
I like the fact that there is a fixed set of
as_*
functions, guaranteeing direct access to the underlying value; but value_to seems to be the "do whatever you need but get me this" convenience method I usually want.Related to #418.
The text was updated successfully, but these errors were encountered: