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 11:21:42 +0100

On Mon, Mar 1, 2010 at 10:47 AM, Michael Goffioul
<address@hidden> wrote:
> On Mon, Mar 1, 2010 at 9:03 AM, Jaroslav Hajek <address@hidden> wrote:
>> 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.
>
> I had a look at your changeset. Can't you use the method
> "void real(double val)" instead? This also exists in MSVC,
> and seems to be part of the C++0x standard (i'm not an expert
> here, I just found a working draft on the web),

where? I didn't see them in the drafts I could found. They're
certainly not part of C++98.



-- 
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]