-
Notifications
You must be signed in to change notification settings - Fork 83
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
Implement std::visit interface for json values. #71
Comments
It seems to be easy, please try with the latest commit - and let's hope that I didn't miss any important reason why it can't always be so easy :-) |
Are we sure we want to do it this way? We could also expose the variant with an accessor (getter) and instead of (I even considered deriving from |
alternatively, specializing or providing the interface needed for std::visit (std::get and index I believe?) |
Unfortunately that is not allowed, |
@d-frey Yes, how far do we want to expose the variant? I guess at this point there aren't too many reasons to keep it private? We advertise as being standard containers based, we use the standard string classes, so we might as well complete the picture. And then offering a getter could replace |
Since it seems to fit with both the design of the library and the code we decided to implement a getter called |
It would be nice to be able to use visitors on json values like you would with std::visit.
see: https://en.cppreference.com/w/cpp/utility/variant/visit
The text was updated successfully, but these errors were encountered: