swig/Lib/python/std_complex.i
William S Fulton e01cfd70c7 Add missing declaration for std::complex
Fixes missing type information for std::complex in scripting languages.
Closes #732.

Update Javascript and Octave complextest, although they don't actually
get run as they don't work
2017-10-02 19:07:24 +01:00

27 lines
608 B
OpenEdge ABL

/*
* STD C++ complex typemaps
*/
%include <pycomplex.swg>
%{
#include <complex>
%}
namespace std {
%naturalvar complex;
template<typename T> class complex;
%template() complex<double>;
%template() complex<float>;
}
/* defining the complex as/from converters */
%swig_cplxdbl_convn(std::complex<double>, std::complex<double>, std::real, std::imag)
%swig_cplxflt_convn(std::complex<float>, std::complex<float>, std::real, std::imag)
/* defining the typemaps */
%typemaps_primitive(%checkcode(CPLXDBL), std::complex<double>);
%typemaps_primitive(%checkcode(CPLXFLT), std::complex<float>);