Re: GCC 4.0 Ada.Containers Cursor danger.



Dmitry A. Kazakov wrote:
On Wed, 6 Jul 2005 18:07:38 -0500, Randy Brukardt wrote:

It is not clear to me what the semantics a cursor has. Is it a location in the container?

It's not a location, and it wouldn't make sense for it to be one (other than
for a Vector).

But it definitely refers to a location. Otherwise iteration using cursor
would be impossible.

Why? A cursor designates an element. There are operations on cursors, some of them let us move a cursor from one element to another. Then the cursor designates another element.

I don't think there an implied requirement to think of locations.

   type Cursor is private;
 private
   type Cursor is access function (c: Container) return Pointer;


-- Georg .




Relevant Pages