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

Add type_caster<std::monostate> #3818

Merged
merged 7 commits into from
Mar 22, 2022
Merged

Add type_caster<std::monostate> #3818

merged 7 commits into from
Mar 22, 2022

Conversation

laramiel
Copy link
Contributor

@laramiel laramiel commented Mar 22, 2022

Description

std::monostate is a tag type that allows std::variant to act as an optional, or allows default construction of a std::variant holding a non-default constructible type.

Here a type_caster<std::monostate> is added that specializes void_caster<>, as well as tests for the same.

Suggested changelog entry:

``type_caster<std::monostate>`` was added. ``std::monostate`` is a tag type that allows ``std::variant`` to act as an optional, or allows default construction of a ``std::variant`` holding a non-default constructible type.

@rwgk
Copy link
Collaborator

rwgk commented Mar 22, 2022

Oops, LGTM but the CI isn't happy. I'll look again when it is green.

@laramiel
Copy link
Contributor Author

Sorry about that; did most of these edits directly in the browser.

@rwgk rwgk requested a review from Skylion007 March 22, 2022 01:58
@rwgk
Copy link
Collaborator

rwgk commented Mar 22, 2022

Thanks Aaron!

@rwgk rwgk merged commit b22ee64 into pybind:master Mar 22, 2022
@github-actions github-actions bot added the needs changelog Possibly needs a changelog entry label Mar 22, 2022
@laramiel laramiel deleted the patch-2 branch March 22, 2022 08:21
@henryiii henryiii removed the needs changelog Possibly needs a changelog entry label Mar 29, 2022
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.

4 participants