mirror of
https://github.com/pybind/pybind11.git
synced 2025-01-31 23:30:30 +00:00
Drop constraints on casting of std::shared_ptr
std::shared_ptrs can be shared across python and C++ by design.
This commit is contained in:
parent
29e46381e4
commit
7cf53ae8b4
@ -623,12 +623,6 @@ struct smart_holder_type_caster<std::shared_ptr<T>> : smart_holder_type_caster_l
|
||||
static constexpr auto name = _<std::shared_ptr<T>>();
|
||||
|
||||
static handle cast(const std::shared_ptr<T> &src, return_value_policy policy, handle parent) {
|
||||
if (policy != return_value_policy::automatic
|
||||
&& policy != return_value_policy::reference_internal) {
|
||||
// SMART_HOLDER_WIP: IMPROVABLE: Error message.
|
||||
throw cast_error("Invalid return_value_policy for shared_ptr.");
|
||||
}
|
||||
|
||||
auto src_raw_ptr = src.get();
|
||||
auto st = type_caster_base<T>::src_and_type(src_raw_ptr);
|
||||
if (st.first == nullptr)
|
||||
|
Loading…
Reference in New Issue
Block a user