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

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -