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=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!postnews.google.com!g47g2000cwa.googlegroups.com!not-for-mail From: "Dmitriy Anisimkov" Newsgroups: comp.lang.ada Subject: Re: GCC 4.0 Ada.Containers Cursor danger. Date: 4 Jul 2005 21:27:35 -0700 Organization: http://groups.google.com Message-ID: <1120537655.300974.310780@g47g2000cwa.googlegroups.com> References: <1120474891.635131.216700@g44g2000cwa.googlegroups.com> <42C98672.3020705@arcor.de> NNTP-Posting-Host: 80.89.131.48 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1120537660 751 127.0.0.1 (5 Jul 2005 04:27:40 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 5 Jul 2005 04:27:40 +0000 (UTC) In-Reply-To: <42C98672.3020705@arcor.de> User-Agent: G2/0.2 Complaints-To: groups-abuse@google.com Injection-Info: g47g2000cwa.googlegroups.com; posting-host=80.89.131.48; posting-account=t4CEmgwAAAA8dL2naG2k3iz_rN__dZy3 Xref: g2news1.google.com comp.lang.ada:11861 Date: 2005-07-04T21:27:35-07:00 List-Id: <<"A Cursor value is *invalid* if any of the following have occurred since it was created: ... * The node it designates has been deleted from the map." >> Sure i understand that cursor become invalid. If the danger is written in RM it is not become less danger. <> Should be, because we could not make access to be invalid other then to do *Unchecked_Deallocation* on it. Cursors could become invalid a much more easier. I think access types in Ada safer than cursors in proposed Ada.Containers. <> Because it is just example. Real code was different, and mistake was made by the different person, i just found the error. ---------------------------- Table.Insert (Container, "two", 2222, Cursor, Success); if not Success then Some_Package.Delete_From_Container (Key => "two"); end if; Table.Replace_Element (Cursor, -22222); --------------------