Skip to content

Commit 3a1744b

Browse files
committed
SimpleTypedDataBinding : Fix half on clang
Explicitly defining / casting the data type returned by `extract()` fixes an error when building with clang where it would fail to find a constructor for `half` : `error: no viable conversion from 'boost::python::extract<Imath::half>' to 'Imath_3_1::half'`
1 parent 9237632 commit 3a1744b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

include/IECorePython/SimpleTypedDataBinding.inl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ template<typename T>
6363
void TypedDataFromType<T>::construct( PyObject *obj, boost::python::converter::rvalue_from_python_stage1_data *data )
6464
{
6565
void *storage = ((boost::python::converter::rvalue_from_python_storage<typename T::Ptr>*)data)->storage.bytes;
66-
new (storage) typename T::Ptr( new T( boost::python::extract<typename T::ValueType>( obj ) ) );
66+
typename T::ValueType v = boost::python::extract<typename T::ValueType>( obj );
67+
new (storage) typename T::Ptr( new T( v ) );
6768
data->convertible = storage;
6869
}
6970

0 commit comments

Comments
 (0)