/* * STD C++ complex typemaps */ %include %{ #include %} namespace std { %naturalvar complex; template class complex; %template() complex; %template() complex; } /* defining the complex as/from converters */ %swig_cplxdbl_convn(std::complex, std::complex, std::real, std::imag) %swig_cplxflt_convn(std::complex, std::complex, std::real, std::imag) /* defining the typemaps */ %typemaps_primitive(%checkcode(CPLXDBL), std::complex); %typemaps_primitive(%checkcode(CPLXFLT), std::complex);