Mail Archives: djgpp/2004/03/31/07:45:15
Chris <chris_tebbe AT yahoo DOT com> wrote:
> As a result of my last posting, I apparently have a little catching up
> to do on the "new" C++ relative to updating my old programs. So,
> here's another one for the DJGPP warriors:
You actually are addressing the wrong tribe of warriors. This is a
pure C++ language problem quite unrelated to DJGPP in particular,
which you should be bringing to the attention of comp.lang.c++
instead.
> weight=weight+(Matrix&)(rate*(Matrix&)DeltaWeight);
I'm almost 100% certain you should neither need, nor use those casts
to (Matrix&). C-style casts are generally frowned upon in modern C++,
and I'd be very surprised if you needed them in the case at hand.
> In my header file, I have also overloaded the double() function to
> allow the casting of a 1x1 matrix into a double,
I don't think that was a good idea. You can't meaningfully make the
existence of such an override depend on a member variable (the size).
Given that this will disrupt the automatic discovery of the right
overloaded operators to use (as shown by your error message), I
strongly suggest you get rid of the overloaded cast to double.
--
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.
- Raw text -