File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -409,7 +409,6 @@ class cpp_function : public function {
409
409
}
410
410
}
411
411
}
412
-
413
412
if (kwargs_consumed == nkwargs)
414
413
result = it->impl (it, args_, parent);
415
414
@@ -937,10 +936,11 @@ template <typename Type> class enum_ : public class_<Type> {
937
936
((it == entries->end ()) ? std::string (" ???" )
938
937
: std::string (it->second ));
939
938
});
940
- this ->def (" __init__" , [](Type& value, int i) { value = (Type) i; });
939
+ this ->def (" __init__" , [](Type& value, int i) { value = (Type)i; });
940
+ this ->def (" __init__" , [](Type& value, int i) { new (&value) Type ((Type) i); });
941
941
this ->def (" __int__" , [](Type value) { return (int ) value; });
942
- this ->def (" __eq__" , [](const Type &value, Type value2) { return value == value2; });
943
- this ->def (" __ne__" , [](const Type &value, Type value2) { return value != value2; });
942
+ this ->def (" __eq__" , [](const Type &value, Type * value2) { return value2 && value == * value2; });
943
+ this ->def (" __ne__" , [](const Type &value, Type * value2) { return !value2 || value != * value2; });
944
944
this ->def (" __hash__" , [](const Type &value) { return (int ) value; });
945
945
m_entries = entries;
946
946
}
You can’t perform that action at this time.
0 commit comments