[Xcb] Iter
Jeremy Kolb
jkolb at brandeis.edu
Sat Dec 17 16:56:38 PST 2005
Jamey Sharp wrote:
> On Sat, Dec 17, 2005 at 06:56:23PM -0500, Jeremy Kolb wrote:
>
>>I feel like we should either provide both or just use the iterators
>>interface. It's kind of confusing.
>
>
> Note that some lists *don't* get iterators, because they're primitive
> types -- all the strings are array-access only, for example. So there
> are three categories: array-only, iterator-only, and both.
>
> Yes, maybe that is a bit confusing. But when they're available arrays
> are so convenient under many circumstances, and I expect if we take them
> away people are going to start pretending that the pointer inside the
> iterator is actually an array, and then they're going to do that for
> types where that doesn't work, and that'll be even more confusing. At
> least this way you get a compile-time error if you try to use an access
> method that isn't available.
>
> --Jamey
>
The problem with having some of these "iterator only" is that you may
need to access data already gone over. I think we should bite the
bullet and just provide array access. I don't think it would be too
difficult to copy data around (though I don't know much about the
internal design of XCB so I can't really comment on that). The
namespace is hard enough to read as it is ;)
Jeremy
More information about the Xcb
mailing list