Also apply csvar{in,out} typemaps to std::complex references
This is needed to handle the artificial complex-valued properties created using %naturalvar correctly.
This commit is contained in:
parent
485efd511f
commit
95aa3d9389
1 changed files with 2 additions and 2 deletions
|
|
@ -33,14 +33,14 @@ public:
|
||||||
return new System.Numerics.Complex(cppret.real(), cppret.imag());
|
return new System.Numerics.Complex(cppret.real(), cppret.imag());
|
||||||
}
|
}
|
||||||
|
|
||||||
%typemap(csvarin, excode=SWIGEXCODE2) std::complex<T>* %{
|
%typemap(csvarin, excode=SWIGEXCODE2) std::complex<T>*, const std::complex<T>& %{
|
||||||
set {
|
set {
|
||||||
var cppvalue = new Complex_##T((T)value.Real, (T)value.Imaginary);
|
var cppvalue = new Complex_##T((T)value.Real, (T)value.Imaginary);
|
||||||
$imcall;$excode
|
$imcall;$excode
|
||||||
}
|
}
|
||||||
%}
|
%}
|
||||||
|
|
||||||
%typemap(csvarout, excode=SWIGEXCODE2) std::complex<T>* %{
|
%typemap(csvarout, excode=SWIGEXCODE2) std::complex<T>*, const std::complex<T>& %{
|
||||||
get {
|
get {
|
||||||
var cppret = new Complex_##T($imcall, $owner);$excode
|
var cppret = new Complex_##T($imcall, $owner);$excode
|
||||||
return new System.Numerics.Complex(cppret.real(), cppret.imag());
|
return new System.Numerics.Complex(cppret.real(), cppret.imag());
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue