octave-maintainers
[Top][All Lists]
Advanced

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

Re: Problem compiling oct-norm.cc with MSVC


From: Jaroslav Hajek
Subject: Re: Problem compiling oct-norm.cc with MSVC
Date: Sun, 9 Nov 2008 13:51:34 +0100

On Sat, Nov 8, 2008 at 3:42 PM, Michael Goffioul
<address@hidden> wrote:
> I pulled from octave archive today and I have problems
> compiling oct-norm.cc with MSVC. The error is the following
>
> c:\sources\playground\c\octave-graphics-hg\liboctave\Array.cc(1861) :
> error C2784: 'bool operator <(const float &,const octave_int<T> &)' :
> could not deduce template argument for 'const octave_int<T> &' from
> 'Complex'
>        
> c:\sources\playground\c\octave-graphics-hg\liboctave\oct-inttypes.h(1089)
> : see declaration of 'operator <'
>        c:\sources\playground\c\octave-graphics-hg\liboctave\Array.cc(1962)
> : see reference to function template instantiation 'bool
> ascending_compare<T>(vec_index<T> *,vec_index<T> *)' being compiled
>        with
>        [
>            T=Complex
>        ]
>        c:\sources\playground\c\octave-graphics-hg\liboctave\Array.cc(1941)
> : while compiling class template member function 'Array<T>
> Array<T>::sort(Array<octave_idx_type> &,octave_idx_type,sortmode)
> const'
>        with
>        [
>            T=Complex
>        ]
>        c:\sources\playground\c\octave-graphics-hg\liboctave\Array2.h(43)
> : see reference to class template instantiation 'Array<T>' being
> compiled
>        with
>        [
>            T=Complex
>        ]
>        c:\sources\playground\c\octave-graphics-hg\liboctave\MArray2.h(41)
> : see reference to class template instantiation 'Array2<T>' being
> compiled
>        with
>        [
>            T=Complex
>        ]
>        c:\sources\playground\c\octave-graphics-hg\liboctave\CMatrix.h(38)
> : see reference to class template instantiation 'MArray2<T>' being
> compiled
>        with
>        [
>            T=Complex
>        ]
>
> It looks like MSVC is trying to find an implementation of < for complex
> arguments. This seems to be a recent problem as I did have it last
> week. Does anybody has a hint?
>
> Thanks,
> Michael.
>

This seems to be a bit complicated problem. The problem is that I need
to include
Array.cc in oct-norm.cc due to using Array<ACC>, but this then
apparently causes  the Array<Complex> methods to be instantiated
rather than used as external.
This is not the first time I thought that Array<T> itself is a little
too complex requiring the < operator to be defined for its element.
Since the other <> operators are defined in MArray, I personally think
that the sort methods should be moved here, too. Any objections?
In any case, it's probably useless to instantiate all the complexity
of Array<T> just for its use as a 1D container, which is what
oct-norm.cc does. std::vector can be easily used instead.
Please verify that the patch
http://hg.savannah.gnu.org/hgweb/octave/rev/5fe0f4dfdbec
fixes your problem.

regards

-- 
RNDr. Jaroslav Hajek
computing expert
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]