comp.lang.ada
 help / color / mirror / Atom feed
* overloding the equals operator
@ 1986-09-26 14:23 Roger Racine
  0 siblings, 0 replies; only message in thread
From: Roger Racine @ 1986-09-26 14:23 UTC (permalink / raw)


Could someone please explain WHY one needs to use a derived type
to overload the "=" operator? In particular, why does this not work?

Instead of:

function "="(left, right : my_type) return boolean;

I tried :

function "="(first, second : my_type) return boolean;

I thought that when the access type was declared, an implicit declaration
of the function "="(left, right : my_type) return boolean would occur.
Then by using named notation inside the body of "=" I would be able to
use the implicit "=".

It does not work. Is this due to some rule about scope? Or are the two 
compilers I checked it on wrong?
-------

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1986-09-26 14:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1986-09-26 14:23 overloding the equals operator Roger Racine

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox