Index: [thread] [date] [subject] [author]
  From: Tim Bain <tpb2@duke.edu>
  To  : 
  Date: Mon, 01 Feb 1999 04:44:01 -0500

Problem defining negative operator...

I've been having trouble implementing the negative operator (-).
I've been following the format of most of the other operators in
exptree.h and exptree.icc, but the compiler doesn't seem to like
it no matter how I define it.  This is the code I have for it in each
of the two files:

In exptree.h:
friend Expression operator- ( );

And in exptree.icc:
inline Expression operator- ()
{
   return Expression(new Negative(lhs.MakeNode()));
}

Am I missing something really obvious, because g++ keeps saying
things like:

exptree.icc:69: `operator -()' must have an argument of class or
enumerated type
exptree.icc:69: `operator -()' must take either one or two arguments

Can anyone help with this one?  Thanks!

Tim



Index: [thread] [date] [subject] [author]