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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.107.20.2 with SMTP id 2mr3157064iou.16.1510205862291; Wed, 08 Nov 2017 21:37:42 -0800 (PST) X-Received: by 10.157.95.5 with SMTP id f5mr145960oti.9.1510205862219; Wed, 08 Nov 2017 21:37:42 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!weretis.net!feeder4.news.weretis.net!news.fcku.it!peer02.fr7!futter-mich.highwinds-media.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!186no229659itu.0!news-out.google.com!193ni546iti.0!nntp.google.com!l196no224256itl.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 8 Nov 2017 21:37:42 -0800 (PST) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=173.71.208.22; posting-account=QF6XPQoAAABce2NyPxxDAaKdAkN6RgAf NNTP-Posting-Host: 173.71.208.22 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Comparing Access Types From: Jere Injection-Date: Thu, 09 Nov 2017 05:37:42 +0000 Content-Type: text/plain; charset="UTF-8" X-Received-Body-CRC: 2573574556 X-Received-Bytes: 2378 Xref: feeder.eternal-september.org comp.lang.ada:48777 Date: 2017-11-08T21:37:42-08:00 List-Id: I have a package which uses a type to wrap an access type. I thought it might be nice to provide the basic comparison functions, "=", "<", ">", etc. but access types can only be compared using "=" and "/=". I figured that way, my types could be used in some sort of sorted container, like a map. I want to keep the incomplete type for other reasons, so that seems to limit my options. 1. Address_To_Access_Conversions is out (cannot use an incomplete type) 2. I cannot simply do var.all'Address (Again, incomplete type) Is there some way to do this within the Ada standard or am I hamstrung due to the incomplete type specification? Also, why weren't <, >, <=, >= provided for access types. Even if the representation of an Access type is implementation defined, surely those operators could have been defined. A toned down example: generic type Item_Type(<>); type Item_Access is access Item_Type; package My_Package is type Some_Type is record Reference : Item_Access := null; end record; function "<" (Left,Right : Some_Type) return Boolean; end My_Package; package body My_Package is function "<" (Left,Right : Some_Type) return Boolean is begin return Left.Reference < Right.Reference; --fails to compile end "<"; end My_Package