@@ -871,14 +871,14 @@ struct copyable_holder_caster<
871
871
pybind11_fail (" Passing `std::shared_ptr<T> *` from Python to C++ is not supported "
872
872
" (inherently unsafe)." );
873
873
}
874
- return std::addressof (shared_ptr_holder );
874
+ return std::addressof (shared_ptr_storage );
875
875
}
876
876
877
877
explicit operator std::shared_ptr<type> &() {
878
878
if (typeinfo->holder_enum_v == detail::holder_enum_t ::smart_holder) {
879
- shared_ptr_holder = sh_load_helper.load_as_shared_ptr (value);
879
+ shared_ptr_storage = sh_load_helper.load_as_shared_ptr (value);
880
880
}
881
- return shared_ptr_holder ;
881
+ return shared_ptr_storage ;
882
882
}
883
883
884
884
static handle
@@ -924,7 +924,7 @@ struct copyable_holder_caster<
924
924
}
925
925
if (v_h.holder_constructed ()) {
926
926
value = v_h.value_ptr ();
927
- shared_ptr_holder = v_h.template holder <std::shared_ptr<type>>();
927
+ shared_ptr_storage = v_h.template holder <std::shared_ptr<type>>();
928
928
return ;
929
929
}
930
930
throw cast_error (" Unable to cast from non-held to held instance (T& to Holder<T>) "
@@ -953,8 +953,8 @@ struct copyable_holder_caster<
953
953
if (typeinfo->holder_enum_v == detail::holder_enum_t ::smart_holder) {
954
954
sh_load_helper.loaded_v_h = sub_caster.sh_load_helper .loaded_v_h ;
955
955
} else {
956
- shared_ptr_holder
957
- = std::shared_ptr<type>(sub_caster.shared_ptr_holder , (type *) value);
956
+ shared_ptr_storage
957
+ = std::shared_ptr<type>(sub_caster.shared_ptr_storage , (type *) value);
958
958
}
959
959
return true ;
960
960
}
@@ -964,8 +964,8 @@ struct copyable_holder_caster<
964
964
965
965
static bool try_direct_conversions (handle) { return false ; }
966
966
967
- std::shared_ptr<type> shared_ptr_holder;
968
967
smart_holder_type_caster_support::load_helper<remove_cv_t <type>> sh_load_helper; // Const2Mutbl
968
+ std::shared_ptr<type> shared_ptr_storage;
969
969
};
970
970
971
971
#endif // PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT
@@ -1040,7 +1040,7 @@ struct move_only_holder_caster<
1040
1040
policy = return_value_policy::reference_internal;
1041
1041
}
1042
1042
if (policy != return_value_policy::reference_internal) {
1043
- throw cast_error (" Invalid return_value_policy for unique_ptr&" );
1043
+ throw cast_error (" Invalid return_value_policy for const unique_ptr&" );
1044
1044
}
1045
1045
return type_caster_base<type>::cast (src.get (), policy, parent);
1046
1046
}
0 commit comments