[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Problem with std::complex::real implementation under MSVC
From: |
Michael Goffioul |
Subject: |
Problem with std::complex::real implementation under MSVC |
Date: |
Wed, 29 Oct 2008 21:31:26 +0000 |
Hi,
Recently I tried to recompile octave with MSVC and
notice a compilation error that is specific to MSVC,
in lo-specfun.cc. Basically, the problem is that MSVC
does not implement
T& real (void)
but
T real (const T& val)
instead. So for instance, you cannot write something
like the following
y.real () *= expz;
y.imag () *= expz;
In this specific case, you could simply use
y *= expz
because expz is float anyway. And you cannot write
y.imag () = 0.0;
but you could use
y = std::complex (y.real (), 0.0);
I can provide a complete patch, but would such changes
be acceptable?
Michael.
- Problem with std::complex::real implementation under MSVC,
Michael Goffioul <=