Skip to content

Commit bcc40b2

Browse files
committed
type_caster::cast(const &) evidently does not need std::addressof()
1 parent 82c3482 commit bcc40b2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

include/pybind11/detail/smart_holder_type_casters.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ struct smart_holder_type_caster : smart_holder_type_caster_load<T>,
757757
|| policy == return_value_policy::_clif_automatic) {
758758
policy = return_value_policy::copy;
759759
}
760-
return cast(std::addressof(src), policy, parent);
760+
return cast(&src, policy, parent);
761761
// type_caster_base END
762762
}
763763

include/pybind11/detail/type_caster_base.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1116,7 +1116,7 @@ class type_caster_base : public type_caster_generic {
11161116
|| policy == return_value_policy::automatic_reference) {
11171117
policy = return_value_policy::copy;
11181118
}
1119-
return cast(std::addressof(src), policy, parent);
1119+
return cast(&src, policy, parent);
11201120
}
11211121

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

0 commit comments

Comments
 (0)