24 static constexpr
const char value[3] = {
'Z',
c,
'\0' };
25 static std::string
format() {
return std::string(value); }
28 #ifndef PYBIND11_CPP17 38 static constexpr
bool value =
true;
47 if (!convert && !PyComplex_Check(src.
ptr()))
49 Py_complex
result = PyComplex_AsCComplex(src.
ptr());
50 if (result.real == -1.0 && PyErr_Occurred()) {
54 value = std::complex<T>((
T) result.real, (
T) result.imag);
59 return PyComplex_FromDoubles((
double) src.real(), (double) src.imag());
static handle cast(const std::complex< T > &src, return_value_policy, handle)
PyObject * ptr() const
Return the underlying PyObject * pointer.
#define PYBIND11_NAMESPACE
bool convert(const int &y)
Eigen::Triplet< double > T
typename std::enable_if< B, T >::type enable_if_t
from cpp_future import (convenient aliases from C++14/17)
bool load(handle src, bool convert)
return_value_policy
Approach used to cast a previously unknown C++ instance into a Python object.
#define PYBIND11_TYPE_CASTER(type, py_name)
#define PYBIND11_NAMESPACE_END(name)
#define PYBIND11_NAMESPACE_BEGIN(name)