ykiko hace 1 año
padre
commit
4e5021089c
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      include/pybind11/internal/cast.h

+ 2 - 2
include/pybind11/internal/cast.h

@@ -99,12 +99,12 @@ struct type_caster<T, std::enable_if_t<is_floating_point_v<T>>> {
 
     bool load(handle src, bool convert) {
         if(isinstance<pkbind::float_>(src)) {
-            data = py_tofloat(src.ptr());
+            data = static_cast<T>(py_tofloat(src.ptr()));
             return true;
         }
 
         if(convert && isinstance<pkbind::int_>(src)) {
-            data = py_toint(src.ptr());
+            data = static_cast<T>(py_toint(src.ptr()));
             return true;
         }