[comp.lang.c] operator functions and classes

portuesi@tweezers.esd.sgi.com (Michael Portuesi) (09/25/89)

In article <1989Sep22.073138.19684@lth.se> newsuser@lth.se (LTH network news server) writes:

   We cannot define our own operator functions on
   the boolean data type, because one of the arguments must be a class object.

	   boolean operator == (boolean x, boolean y) {...}	// error

   I do not understand exactly why this restriction is required, but apparently
   it is.  Please enlighten me.


I'm pretty sure the reason why one of the arguments must be a class
object is to prevent the redefintion of operator functions for base
types such as int, float and char.

				--M

--
__
\/  Michael Portuesi	Silicon Graphics Computer Systems, Inc.
			portuesi@SGI.COM

"The best length for television programs is either 30 seconds or 8
hours." David Byrne