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 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!nntp-feed.chiark.greenend.org.uk!ewrotcd!newsfeed.xs3.de!io.xs3.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Getting the index for an element in mutually referencing containers Date: Wed, 15 Mar 2017 15:12:24 -0500 Organization: JSA Research & Innovation Message-ID: References: <86o9xa36oq.fsf@gaheris.avalon.lan> <86k27xpikd.fsf@gaheris.avalon.lan> <86wpbxneuz.fsf@gaheris.avalon.lan> NNTP-Posting-Host: rrsoftware.com X-Trace: franka.jacob-sparre.dk 1489608745 15864 24.196.82.226 (15 Mar 2017 20:12:25 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Wed, 15 Mar 2017 20:12:25 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: news.eternal-september.org comp.lang.ada:33515 Date: 2017-03-15T15:12:24-05:00 List-Id: "Dmitry A. Kazakov" wrote in message news:oaausp$ddn$1@gioia.aioe.org... > On 2017-03-14 21:40, Randy Brukardt wrote: ... > The problem is that the smart pointer type must be anonymous (ad-hoc) like > access T is. Otherwise, you get the problem of parallel type hierarchies > of the targets and the pointers. And the pointer type must have the > interface of the target AKA implicit dereference. The problem of parallel type hierarchies is one that MUST be solved if one is going to program with hierarchies. It IS fundamental to strong typing, unlike most of these other issues. We really need a solution to it (I've tried some and intend to try more). I don't recall ever needing both "strong" or "weak" references to any data structure. Most structures only need short-lived references, and the ones that need long-lived ones are almost always permanent (only changed between runs). Maybe that's because when the only tool you have is an access type, every reference looks unchecked and dangerous. :-) But I doubt that many problems need or care about the both possibilities. Randy.