comp.lang.ada
 help / color / mirror / Atom feed
From: RRACINE@ADA20.ISI.EDU (Roger Racine)
Subject: overloding the equals operator
Date: Fri, 26-Sep-86 10:23:43 EDT	[thread overview]
Date: Fri Sep 26 10:23:43 1986
Message-ID: <8609271155.AA05214@ucbvax.Berkeley.EDU> (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?
-------

                 reply	other threads:[~1986-09-26 14:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
replies disabled

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