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,f2690a5e963b61b6 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news.glorb.com!news.germany.com!newsfeed.arcor.de!news.arcor.de!not-for-mail Date: Sun, 17 Jul 2005 11:28:31 +0200 From: Georg Bauhaus User-Agent: Debian Thunderbird 1.0.2 (X11/20050331) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: GCC 4.0 Ada.Containers Cursor danger. References: <1120474891.635131.216700@g44g2000cwa.googlegroups.com> <1121573057.159416.274980@g49g2000cwa.googlegroups.com> In-Reply-To: <1121573057.159416.274980@g49g2000cwa.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <42da2eb5$0$20137$9b4e6d93@newsread2.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 17 Jul 2005 12:11:01 MEST NNTP-Posting-Host: fab340aa.newsread2.arcor-online.net X-Trace: DXC=o?FjUSSoBWKUhhl_USDNiOQ5U85hF6f;DjW\KbG]kaMHA@_25la3nbB\B^=X7ZPj[IhP3YJKgE\jLiFlKBSGCJRN X-Complaints-To: abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:3646 Date: 2005-07-17T12:11:01+02:00 List-Id: Dmitriy Anisimkov wrote: > M.Delete (C2); > pragma Assert (not Has_Element (C2)); > pragma Assert (not M.Contains ("two")); > -- double hash overhead. > > Replace_Element (C, -2); -- dangling cursor I thought the Replace_Element line was the source of an undetected dangling cursor in your initial example. Supposedly the new checking is inside Replace_Element, which now fails with "bad cursor in Replace_Element". The two asserts above look like "informative" assertions to me, expressing what Delete has done. They are not in the library, they are in a client program, and therefore don't add overhead to library subprograms at all. They also don't check C. -- Georg