mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-11 08:03:55 +00:00
Fix optional dereference type deduction
This commit is contained in:
parent
a3daf87d45
commit
556277d689
@ -266,7 +266,8 @@ template<typename T> struct optional_caster {
|
|||||||
static handle cast(T_ &&src, return_value_policy policy, handle parent) {
|
static handle cast(T_ &&src, return_value_policy policy, handle parent) {
|
||||||
if (!src)
|
if (!src)
|
||||||
return none().inc_ref();
|
return none().inc_ref();
|
||||||
policy = return_value_policy_override<typename T::value_type>::policy(policy);
|
using dereference_type = decltype(*std::forward<T_>(src));
|
||||||
|
policy = return_value_policy_override<dereference_type>::policy(policy);
|
||||||
return value_conv::cast(*std::forward<T_>(src), policy, parent);
|
return value_conv::cast(*std::forward<T_>(src), policy, parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user