Re: GCC 4.0 Ada.Containers Cursor danger.



"Dmitriy Anisimkov" <anisimkov@xxxxxxxxx> wrote in message
news:1120740766.343393.168420@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> << No. A raw access type could never be checked, while a Cursor can
> (and IMHO,
> should) be checked for problems. >>
>
> The checking of the cursors could take considerable size and
> performance.

Only if you insist upon perfect checking. If you are willing to miss 0.01%
of the errors, the cost is quite small. Note that to allow a 99.9% checking
system, we have to officially say that access to invalid cursors is
erroneous.

If you had used the RRS implementation of cursors, you would have gotten
Program_Error when you used the bad cursor. End of issue. I think that such
checking should be part of every implementation of the containers. (Perhaps
a way to turn off checking needs to be provided as well, but I'm unconvinced
that the performance loss from the checking would matter to any real
applications.)

Randy.



.