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

[smart_holder] Backport of pybind11clif type_caster_std_function_specializations feature. #5289

Conversation

rwgk
Copy link
Collaborator

@rwgk rwgk commented Aug 6, 2024

Description

Equivalent of PR #4597 (and google/pybind11clif#30022), but based on pybind11clif main @ commit ab472bbce81de4e0ae41d861a5c46903968f7b27.

The pybind11clif return_value_policy_pack and function_record changes were backed out.

The resulting net diffs to PR #4597 is merely:

+#define PYBIND11_HAS_TYPE_CASTER_STD_FUNCTION_SPECIALIZATIONS

For completeness, note that this std::move needs to be dropped to resolve a clang-tidy error:

-    explicit func_wrapper_base(func_handle &&hf) noexcept : hfunc(std::move(hf)) {}
+    explicit func_wrapper_base(func_handle &&hf) noexcept : hfunc(hf) {}

Suggested changelog entry:

…81de4e0ae41d861a5c46903968f7b27

The pybind11k `return_value_policy_pack` and `function_record` changes were backed out.

The net diffs to PR pybind#4597 are merely:

```diff
+#define PYBIND11_HAS_TYPE_CASTER_STD_FUNCTION_SPECIALIZATIONS
```

```diff
-    explicit func_wrapper_base(func_handle &&hf) noexcept : hfunc(hf) {}
+    explicit func_wrapper_base(func_handle &&hf) noexcept : hfunc(std::move(hf)) {}
```
@rwgk rwgk changed the title Backport of pybind11k type_caster_std_function_specializations feature. [smart_holder] Backport of pybind11k type_caster_std_function_specializations feature. Aug 6, 2024
```
/__w/pybind11/pybind11/include/pybind11/functional.h:47:67: error: passing result of std::move() as a const reference argument; no move will actually happen [performance-move-const-arg,-warnings-as-errors]
   47 |     explicit func_wrapper_base(func_handle &&hf) noexcept : hfunc(std::move(hf)) {}
      |                                                                   ^~~~~~~~~~  ~
/__w/pybind11/pybind11/include/pybind11/functional.h:23:8: note: 'func_handle' is not move assignable/constructible
```
copybara-service bot pushed a commit to pybind/pybind11_abseil that referenced this pull request Aug 6, 2024
…turn_value_policy_pack` feature.

This is for pybind/pybind11#5289 applied to smart_holder.

PiperOrigin-RevId: 659808208
copybara-service bot pushed a commit to pybind/pybind11_abseil that referenced this pull request Aug 6, 2024
…turn_value_policy_pack` feature.

This is for pybind/pybind11#5289 applied to smart_holder.

PiperOrigin-RevId: 659808208
copybara-service bot pushed a commit to pybind/pybind11_abseil that referenced this pull request Aug 6, 2024
…turn_value_policy_pack` feature.

This is for pybind/pybind11#5289 applied to smart_holder.

PiperOrigin-RevId: 659973774
@rwgk
Copy link
Collaborator Author

rwgk commented Aug 9, 2024

The equivalent PR #4597 was merged into master.

@rwgk rwgk closed this Aug 9, 2024
@rwgk rwgk deleted the type_caster_std_function_specializations_sh branch August 9, 2024 20:37
@rwgk rwgk changed the title [smart_holder] Backport of pybind11k type_caster_std_function_specializations feature. [smart_holder] Backport of pybind11clif type_caster_std_function_specializations feature. Aug 26, 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.

1 participant