[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problem compiling sparse-xdiv.cc (typename)
From: |
Jaroslav Hajek |
Subject: |
Re: Problem compiling sparse-xdiv.cc (typename) |
Date: |
Sat, 9 May 2009 17:20:03 +0200 |
On Sat, May 9, 2009 at 4:29 PM, Michael Goffioul
<address@hidden> wrote:
> Hi,
>
> While trying to compile recent octave archive with MSVC, I got a compilation
> error at sparse-xdiv.cc, at the statement:
>
> const typename DM::element_type zero = typename DM::element_type ();
>
> Specifically, MSVC cannot interpret correctly the part "typename
> DM::element_type ()"
> and looks for a static member element_type. It seems to ignore the typename
> keyword when used in a constructor-like construct. I worked around that by
> using
>
> const typename DM::element_type zero = 0;
>
> but I'm not sure this is semantically the same. Is there any other way to work
> around that problem?
>
It's not strictly the same, but it should work for all types diagonal
matrices are currently instantiated for. Another possible workaround
is probably to use
typedef typename DM::element_type DMT;
const DMT zero = DMT ();
However, the code seems valid to me. I think that typename always
applies to the following qualified dependent name, regardless of any
operators following. So I suspect it's a MSVC++ bug. I think our
current (kind of unofficial) policy is that only the mainstream gcc
version is worth putting workarounds into Octave code itself (if the
code is otherwise OK). So I suggest you keep a compatibility patch for
MSVC++ and report the bug. Maybe it's going to be fixed soon.
Btw. I keep another workaround patch for Intel C++. I reported the bug
in question to Intel 2 months ago, but no trace of a progress yet :(
As you may have noticed, gcc 3 doesn't compile Octave either.
regards
--
RNDr. Jaroslav Hajek
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz
- Problem compiling sparse-xdiv.cc (typename), Michael Goffioul, 2009/05/09
- Problem compiling sparse-xdiv.cc (typename), Michael Goffioul, 2009/05/09
- Re: Problem compiling sparse-xdiv.cc (typename),
Jaroslav Hajek <=
- Re: Problem compiling sparse-xdiv.cc (typename), Michael Goffioul, 2009/05/09
- Re: Problem compiling sparse-xdiv.cc (typename), David Bateman, 2009/05/09
- Re: Problem compiling sparse-xdiv.cc (typename), Jaroslav Hajek, 2009/05/10
- Re: Problem compiling sparse-xdiv.cc (typename), Michael Goffioul, 2009/05/10
- Re: Problem compiling sparse-xdiv.cc (typename), Jaroslav Hajek, 2009/05/10
- Re: Problem compiling sparse-xdiv.cc (typename), Michael Goffioul, 2009/05/10
- Re: Problem compiling sparse-xdiv.cc (typename), Søren Hauberg, 2009/05/10
- Re: Problem compiling sparse-xdiv.cc (typename), Jaroslav Hajek, 2009/05/10
- Re: Problem compiling sparse-xdiv.cc (typename), John W. Eaton, 2009/05/11