Rapptz / sol

A C++11 Lua wrapper
MIT License
209 stars 32 forks source link

sol::table::iterator & friends #59

Closed ThePhD closed 9 years ago

ThePhD commented 9 years ago

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!

Rapptz commented 9 years ago

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.

ThePhD commented 9 years ago

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.