According to libcpp/complex.pxd
adding T
to complex[T]
is supported:
complex[T] operator+(complex[T]&, T&)
I've got it working. See cython ticket https://github.com/cython/cython/issues/1643
It is a combination of moving
complex[T] operator+(complex[T]&, T&)
out of cppclass definition, changing it to
complex[T] operator+[T](complex[T]&, T&)
as suggested in the question and @DavidW's idea of cimport *