From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,5a88548f1bcf3510 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,CP1252 Received: by 10.224.205.65 with SMTP id fp1mr6662193qab.4.1352498170930; Fri, 09 Nov 2012 13:56:10 -0800 (PST) Received: by 10.236.143.241 with SMTP id l77mr1938267yhj.10.1352498170909; Fri, 09 Nov 2012 13:56:10 -0800 (PST) Path: gf5ni18188417qab.0!nntp.google.com!c7no14858399qap.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 9 Nov 2012 13:56:10 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=206.53.78.59; posting-account=ShYTIAoAAABytvcS76ZrG9GdaV-nXYKy NNTP-Posting-Host: 206.53.78.59 References: <97a6946f-a707-4dd3-872b-9e851fcf9462@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Overring function and its returned type From: sbelmont700@gmail.com Injection-Date: Fri, 09 Nov 2012 21:56:10 +0000 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Date: 2012-11-09T13:56:10-08:00 List-Id: On Friday, November 9, 2012 4:10:09 PM UTC-5, Hibou57 (Yannick Duch=EAne) w= rote: > > Reading the above, one may say =93that's silly, if you know the returned = =20 >=20 > type, just specify it in the declaration, and this would additionally =20 >=20 > avoid a cumbersome checked conversion at every call place=94. >=20 > That's silly, because in such a case your classwide types are just for show= . If you are already coupled directly to P3, and already know that A is a = P3.T, then you don't need to override or extend or cast anything: you alrea= dy have full visibility for direct calls on anything in P3, and will have t= o go back and change the unit either way if down the road you create a P4. = Just create a non-overriding, not-necessarily-overloading function in P3 t= hat returns whatever type you want, with whatever pre/post conditions you l= ike. -sb