[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [PROPOSAL] a new function: table.proto()
- From: Javier Guerra Giraldez <javier@...>
- Date: Tue, 4 May 2010 11:50:20 -0500
On Tue, May 4, 2010 at 11:42 AM, Benoit Germain <bgermain@ubisoft.fr> wrote:
> The idea would be that with a true vector, there is no such thing as a hole (absent key), and iterating over vector elements can perfectly yield a [scalar/nil] pair without aborting the loop. For a vector, operator # *is* the same thing as std::vector::size(). Thus the highest integer key is the vector's size, and the values can be anything you want, and nil isn't a special case that breaks iteration, just a value like any other.
so a 'true vector' can't resize automatically, but you have to call
resize() (or change_capacity()?), since nil is a valid value and not
an absence.
--
Javier
- References:
- [PROPOSAL] a new function: table.proto(), François Perrad
- RE: [PROPOSAL] a new function: table.proto(), Benoit Germain
- Re: [PROPOSAL] a new function: table.proto(), GrayFace
- RE: [PROPOSAL] a new function: table.proto(), Benoit Germain
- Re: [PROPOSAL] a new function: table.proto(), Javier Guerra Giraldez
- Re: [PROPOSAL] a new function: table.proto(), Alex Queiroz
- Re: [PROPOSAL] a new function: table.proto(), Javier Guerra Giraldez
- RE: [PROPOSAL] a new function: table.proto(), Benoit Germain
- Re: [PROPOSAL] a new function: table.proto(), Javier Guerra Giraldez
- RE: [PROPOSAL] a new function: table.proto(), Benoit Germain