Skip to content

Commit

Permalink
type_caster::cast(const &) evidently does not need std::addressof()
Browse files Browse the repository at this point in the history
  • Loading branch information
Ralf W. Grosse-Kunstleve committed Jan 23, 2024
1 parent 82c3482 commit bcc40b2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/pybind11/detail/smart_holder_type_casters.h
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ struct smart_holder_type_caster : smart_holder_type_caster_load<T>,
|| policy == return_value_policy::_clif_automatic) {
policy = return_value_policy::copy;
}
return cast(std::addressof(src), policy, parent);
return cast(&src, policy, parent);
// type_caster_base END
}

Expand Down
2 changes: 1 addition & 1 deletion include/pybind11/detail/type_caster_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -1116,7 +1116,7 @@ class type_caster_base : public type_caster_generic {
|| policy == return_value_policy::automatic_reference) {
policy = return_value_policy::copy;
}
return cast(std::addressof(src), policy, parent);
return cast(&src, policy, parent);
}

static handle cast(itype &&src, return_value_policy, handle parent) {
Expand Down

0 comments on commit bcc40b2

Please sign in to comment.