[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Add an operator<(Complex, Complex) to oct-sort.cc for non-g++ co
From: |
John W. Eaton |
Subject: |
[PATCH] Add an operator<(Complex, Complex) to oct-sort.cc for non-g++ compilers. |
Date: |
Fri, 30 Nov 2007 14:11:49 -0500 |
On 30-Nov-2007, John W. Eaton wrote:
| On 29-Nov-2007, Jason Riedy wrote:
|
| | The standard rightly does not define ordering operators, but g++'s
| | libstdc++ provides them. Other compilers (e.g. icc) do not, and
| | oct-sort.cc refuses to compile. The included operator is never
| | actually *used* in Octave; src/DLD-FUNCTIONS/sort.cc defines
| | comparison functions for Complex sorts.
|
| I don't see why this would be needed since the Complex versions of
| these templates should not be instantiated except in
| src/DLD-FUNCTIONS/sort.cc, which does provide a definition of
| operator< for Complex values. However, looking at that file, I
| noticed that some of the functions there should probably pass
| arguments by const reference instead of value, so I checked the
| following changes. Does that help? If not, precisely what is the
| error message you see from icc?
Hmm. My changes seem to have resulted in a number of test failures,
so I removed them. Still, I think these functions should be declared
to pass arguments by const reference arguments instead of by value, so
I'll have to take a closer look at this.
jwe