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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,243dc2fb696a49cd X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshosting.com!nx02.iad01.newshosting.com!newsfeeds.sol.net!posts.news.twtelecom.net!nnrp2.twtelecom.net!not-for-mail From: "Matthew Heaney" Newsgroups: comp.lang.ada References: <11b4d.3849$d5.30042@newsb.telia.net> Subject: Re: Ada Popularity: Comparison of Ada/Charles with C++ STL (and Perl) Date: Fri, 24 Sep 2004 17:23:40 -0400 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 Message-ID: <41548dca$0$91003$39cecf19@news.twtelecom.net> Organization: Time-Warner Telecom NNTP-Posting-Date: 24 Sep 2004 21:12:43 GMT NNTP-Posting-Host: d369f62d.news.twtelecom.net X-Trace: DXC=Hgm9oN:Nf@h=e0<5NOFKkjC_A=>8kQj6mhHXa^^g6TZdgb_Rl>hnMPbdYZAA8S: "Randy Brukardt" wrote in message news:sOudnSKh7rXbFMncRVn-jg@megapath.net... > > (I'm intending an implementation of the containers library that will try to > detect dangling cursors, so there will be little chance of building buggy > code with it.) Actually, I had wanted to build something similar for AI-302, once the work on the reference implementation settles down. There are after-market STLs like that, and it wouldn't be hard to build a debug-version of AI-302 for Ada. All you'd need to do to detect dangling cursors is to implement type Cursor as a private derivation from Controlled, and then add a reference count to the internal storage node. If that element (node) is deleted, then you could inspect the reference count to see if it's non-zero.