Xref: utzoo comp.lang.c++:4798 comp.lang.c:22246
Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!sun-barr!lll-winken!arisia!sgi!shinobu!odin!odin.corp.sgi.com!portuesi
From: portuesi@tweezers.esd.sgi.com (Michael Portuesi)
Newsgroups: comp.lang.c++,comp.lang.c
Subject: operator functions and classes (was Re: Time to standardize "true" and "false")
Message-ID: 
Date: 25 Sep 89 08:27:44 GMT
References: <13730@well.UUCP> <1989Sep22.073138.19684@lth.se>
Sender: news@odin.SGI.COM
Reply-To: portuesi@sgi.com (Michael Portuesi)
Distribution: comp
Organization: Silicon Graphics, Inc., Mtn. View, CA
Lines: 24
In-reply-to: newsuser@lth.se's message of 22 Sep 89 07:31:38 GMT

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