84 using namespace boost::python::converter;
86 if (source == Py_None)
89 const registration& converters(registered<T>::converters);
91 if (implicit_rvalue_convertible_from_python(source, converters)) {
92 rvalue_from_python_stage1_data data =
93 rvalue_from_python_stage1(source, converters);
94 return rvalue_from_python_stage2(source, data, converters);
100 boost::python::converter::rvalue_from_python_stage1_data * data)
102 using namespace boost::python::converter;
104 const T value =
typename boost::python::extract<T>(source);
106 void * storage = ((rvalue_from_python_storage<boost::optional<T>>*) data)->storage.bytes;
108 if (source == Py_None)
109 new (storage) boost::optional<T>();
111 new (storage) boost::optional<T>(value);
113 data->convertible = storage;