c++ - Passing Complex real and imag by reference -
the problem: c++11 has made changes complex numbers real()
, imag()
can no longer used , abused member variables. have code converting on passes real()
, imag()
sincosf()
reference. looks little this:
sincosf(/*...*/, &cplx.real(), &cplx.imag());
this gives error: lvalue required unary '&' operand
which error not received prior c++11.
my question: there easy inline fix? or have create temporary variables result , pass complex number via setters?
thanks
just do
cplx = std::polar(1.0f, /*...*/);
Comments
Post a Comment