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

feat: change array_caster in pybind11/stl.h to support value types that are not default-constructible. #5305

Merged
merged 1 commit into from
Aug 15, 2024

Conversation

rwgk
Copy link
Collaborator

@rwgk rwgk commented Aug 13, 2024

Description

Loosely related: #864

However, this PR is specific to array_caster; practically speaking, specific to std::array conversions.

This PR preserves the existing array_caster behavior as much as possible. The only difference is that it also works for value types that are not default-constructible. — Note that without this PR, the new test results in a compiler error.

This PR is a backport of google/pybind11clif#30034

Suggested changelog entry:

The ``array_caster`` in pybind11/stl.h was enhanced to support value types that are not default-constructible.

@rwgk rwgk marked this pull request as ready for review August 13, 2024 20:49
@rwgk
Copy link
Collaborator Author

rwgk commented Aug 15, 2024

Thanks @henryiii!

@rwgk rwgk merged commit a1d0091 into pybind:master Aug 15, 2024
78 checks passed
@rwgk rwgk deleted the stl_h_no_default_ctor branch August 15, 2024 05:30
@github-actions github-actions bot added the needs changelog Possibly needs a changelog entry label Aug 15, 2024
@rwgk
Copy link
Collaborator Author

rwgk commented Aug 15, 2024

@rainwoodman FYI (this was google/pybind11clif#30034)

@henryiii henryiii changed the title Change array_caster in pybind11/stl.h to support value types that are not default-constructible. feat: change array_caster in pybind11/stl.h to support value types that are not default-constructible. Aug 22, 2024
@henryiii henryiii removed the needs changelog Possibly needs a changelog entry label Sep 13, 2024
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