mirror of
https://github.com/pybind/pybind11.git
synced 2026-05-13 09:46:10 +00:00
nicer type_caster::load() calling conventions
This commit is contained in:
@@ -26,6 +26,8 @@ NAMESPACE_BEGIN(detail)
|
||||
template <typename T> class type_caster<std::complex<T>> {
|
||||
public:
|
||||
bool load(handle src, bool) {
|
||||
if (!src)
|
||||
return false;
|
||||
Py_complex result = PyComplex_AsCComplex(src.ptr());
|
||||
if (result.real == -1.0 && PyErr_Occurred()) {
|
||||
PyErr_Clear();
|
||||
|
||||
Reference in New Issue
Block a user