octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C++ complex class use in str2double.cc


From: Jaroslav Hajek
Subject: Re: C++ complex class use in str2double.cc
Date: Mon, 1 Mar 2010 10:03:26 +0100

On Sun, Feb 28, 2010 at 11:50 AM, Michael Goffioul
<address@hidden> wrote:
> While trying to compile str2double.cc with MSVC, it failed because
> std::complex::real()
> is used as an l-value, while in MSVC it's defined as "T real(void)
> const". Is this a
> C++ requirement to have a non-const version, or is it a GNU extension?
>
> Thanks,
> Michael.
>

You're right, the standard only defines the const versions, though I
believe this is a (minor) flaw in C++.
I think the original reasoning was to allow a polar implementation,
which would however be insane for a multitude of other reasons.
Such an implementation would break Octave anyway.

I added non-GNU code to str2double.

regards

-- 
RNDr. Jaroslav Hajek, PhD
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz


reply via email to

[Prev in Thread] Current Thread [Next in Thread]