mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-22 13:15:12 +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) {
|
||||
if (!src)
|
||||
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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user