Rapptz / sol

A C++11 Lua wrapper

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sol::table::iterator & friends

ThePhD opened this issue · comments

libjansson offers a c-style "any" iterator where you can fix values from the type like so. A similar API (that's less wonky since we're in C++) could probably be created and allowed for with table's begin() and end() syntax, using sol::object for values and perhaps a new sol::key type (since keys can only be integers or strings in lua).

I'd be interested in doing this for version 2.0 later on!

commented

I've thought about this before but it didn't seem feasible to do. I could re-consider the issue but I don't think much has changed to make this feasible.

Shit-tier iterator version. I would say this could be made easier but shitty C++ for loops can't handle multiple different types, and there's no "single iterator" type, so. Screw iterators.