[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
- Re: C++ complex class use in str2double.cc,
Jaroslav Hajek <=
- Re: C++ complex class use in str2double.cc, Michael Goffioul, 2010/03/01
- Re: C++ complex class use in str2double.cc, Jaroslav Hajek, 2010/03/01
- Re: C++ complex class use in str2double.cc, Michael Goffioul, 2010/03/01
- Re: C++ complex class use in str2double.cc, Jaroslav Hajek, 2010/03/01
- Re: C++ complex class use in str2double.cc, Michael Goffioul, 2010/03/01
- Re: C++ complex class use in str2double.cc, Jaroslav Hajek, 2010/03/01
- Re: C++ complex class use in str2double.cc, John W. Eaton, 2010/03/01
- Re: C++ complex class use in str2double.cc, John W. Eaton, 2010/03/01
- Re: C++ complex class use in str2double.cc, John W. Eaton, 2010/03/01