Skip to content

Commit 54fd559

Browse files
committed
Fix a minor and inconsequential inconsistency in copyable_holder_caster: the correct load_value() return type is void (as defined in type_caster_generic)
For easy future reference, this is the long-standing inconsistency: * https://github.com/pybind/pybind11/blob/dbf848aff7c37ef8798bc9459a86193e28b1032f/include/pybind11/detail/type_caster_base.h#L634 * https://github.com/pybind/pybind11/blob/dbf848aff7c37ef8798bc9459a86193e28b1032f/include/pybind11/cast.h#L797 Noticed in passing while working on PR #5213.
1 parent 5e30064 commit 54fd559

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/pybind11/cast.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -794,11 +794,11 @@ struct copyable_holder_caster : public type_caster_base<type> {
794794
}
795795
}
796796

797-
bool load_value(value_and_holder &&v_h) {
797+
void load_value(value_and_holder &&v_h) {
798798
if (v_h.holder_constructed()) {
799799
value = v_h.value_ptr();
800800
holder = v_h.template holder<holder_type>();
801-
return true;
801+
return;
802802
}
803803
throw cast_error("Unable to cast from non-held to held instance (T& to Holder<T>) "
804804
#if !defined(PYBIND11_DETAILED_ERROR_MESSAGES)

0 commit comments

Comments
 (0)