It makes sense, it is a leftover of when it was a pointer. I'll do the
modification but I cannot test-build ATM, I'm on a Uni workstation.


On Sun, Apr 14, 2013 at 11:11 PM, John Bartholomew <notifications@github.com
> wrote:

> In src/LuaTable.h:
>
> > +	int Size() const {return lua_rawlen(m_lua, m_index);}
> > +
> > +    /* VecIter, as in VectorIterator (only shorter to type :-)
> > +     *
> > +     * Careful, its LuaTable specialization isn't stable WRT the stack, and using its value
> > +     * will push a table onto the stack, and will only clean it up when the iterator
> > +     * gets destroyed or inc/decremented.
> > +     *
> > +     * For all other values, ponctual operations on the stack may occur but it should
> > +     * not leak anything.
> > +     */
> > +	template <class Value> class VecIter : public std::iterator<std::input_iterator_tag, Value> {
> > +		public:
> > +			VecIter() : m_table(0), m_currentIndex(0), m_cache(), m_dirtyCache(true) {}
> > +			~VecIter() {}
> > +			VecIter(LuaTable * t, int currentIndex): m_table(t), m_currentIndex(currentIndex), m_cache(0), m_dirtyCache(true) {}
>
> Initialising m_cache with 0 breaks (silently) when Value = LuaTable, and
> will probably break in other ways for other Value types.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/pioneerspacesim/pioneer/pull/2170/files#r3786828>
> .
>