Skip to content
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

Support for nullable value types #1460

Merged
merged 6 commits into from
Dec 4, 2024
Merged

Support for nullable value types #1460

merged 6 commits into from
Dec 4, 2024

Conversation

stephenberry
Copy link
Owner

This adds support for optional like types that cannot provide an operator bool() because that operator is reserved for some other action. This adds a nullable_value_t concept that only checks for value() and has_value().

@scalpel4k
Copy link

Nice, this will do the trick for me. Should be mentioned somewhere in the docs, I think.

thanks a lot!

@scalpel4k
Copy link

I've tested it with our code base and it works as intended

@stephenberry
Copy link
Owner Author

Great! I'm about to merge this. I added support for reading nullable value types as well, as long as reset() and emplace() methods are provided. If you don't have these methods on your type then you can just keep using your custom parse specialization.

@stephenberry stephenberry merged commit 6bea4c2 into main Dec 4, 2024
13 checks passed
@stephenberry stephenberry deleted the nullable_value_types branch December 4, 2024 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants