From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-65-14.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-3.2 required=3.0 tests=BAYES_00,NICE_REPLY_A, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R.Carter" Newsgroups: comp.lang.ada Subject: Re: strange cursor in nested containers Date: Tue, 9 May 2023 10:36:33 +0200 Organization: A noiseless patient Spider Message-ID: References: <6aa39f27-62ca-4486-9fc7-1c713da5b098n@googlegroups.com> <9a1c3ba5-d5ae-41d3-9eab-2b8cd941bc66n@googlegroups.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Tue, 9 May 2023 08:36:33 -0000 (UTC) Injection-Info: dont-email.me; posting-host="458747c8624c999a90f84720d28d0279"; logging-data="229861"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+BZELEWrY0XZ87vbnRDY7+zHrUc22Uyyw=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Cancel-Lock: sha1:FNuofo9wT4ohx9bndWjPgcw/3KE= Content-Language: en-US In-Reply-To: Xref: news.eternal-september.org comp.lang.ada:65185 List-Id: On 2023-05-09 05:56, Randy Brukardt wrote: > It's not required to detect such cursors because it is expensive to do so > perfectly (essentially, each cursor has to be controlled and one has to keep > a list of them associated with the container). There are imperfect solutions > which are likely to be "good enough" in practice, but they still have a > (small) cost which may be an issue for some uses. Thus, most implementers > don't use them. I know the original GNAT containers had a debugging version > that included such checks, but I don't know if they still exist or how one > would enable them if they do. This cost is due to the decision to allow access to elements using only a cursor. If both the container and the cursor are needed, then the cost is significantly reduced. This is the approach that was used in the Ada-95 version of the PragmAda Reusable Components. -- Jeff Carter “Bug rates in C++ are running higher even than C ...” Stephen F. Zeigler 216