[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: pair()-like iterator in C++
- From: Leandro Pelorosso <vertexar@...>
- Date: Wed, 2 May 2007 09:16:10 -0700 (PDT)
Indeed, but, don't you know what kind of undefined
behavior can i get?. (maybe something like iterate
elements that i already visit, or something like that)
Thanks for your reply!,
--- Rici Lake <firstname.lastname@example.org> wrote:
> Leandro Pelorosso wrote:
> > Can I add new rows to the table while I iterate
> > all the key-value pairs?
> Not if you iterate with pairs() (or lua_next):
> "The behavior of next is undefined if, during the
> traversal, you assign
> any value to a non-existent field in the table. You
> may however modify
> existing fields. In particular, you may clear
> existing fields."
> (from the Reference Manual)
Sign our Guestbook!
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around