diff --git a/single/sol/sol.hpp b/single/sol/sol.hpp index ab283262..93636c05 100644 --- a/single/sol/sol.hpp +++ b/single/sol/sol.hpp @@ -20,8 +20,8 @@ // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // This file was generated with a script. -// Generated 2017-03-26 15:27:07.597060 UTC -// This header was generated with sol v2.16.0 (revision e27922e) +// Generated 2017-03-30 08:20:24.093445 UTC +// This header was generated with sol v2.16.0 (revision 4f72880) // https://github.com/ThePhD/sol2 #ifndef SOL_SINGLE_INCLUDE_HPP @@ -3590,6 +3590,9 @@ namespace sol { template struct lua_type_of> : std::integral_constant { }; + template + struct lua_type_of> : std::integral_constant {}; + template <> struct lua_type_of : std::integral_constant {}; @@ -5325,53 +5328,50 @@ namespace sol { template struct getter, std::enable_if_t>::value>> { - static T get(lua_State* L, int index, record& tracking) { + static T get(lua_State* L, int relindex, record& tracking) { typedef typename T::value_type V; tracking.use(1); - index = lua_absindex(L, index); + int index = lua_absindex(L, relindex); T arr; - get_field(L, static_cast(-1), index); - int isnum; - std::size_t sizehint = static_cast(lua_tointegerx(L, -1, &isnum)); - if (isnum != 0) { - detail::reserve(arr, sizehint); - } - lua_pop(L, 1); #if SOL_LUA_VERSION >= 503 // This method is HIGHLY performant over regular table iteration thanks to the Lua API changes in 5.3 for (lua_Integer i = 0; ; i += lua_size::value, lua_pop(L, lua_size::value)) { + bool isnil = false; for (int vi = 0; vi < lua_size::value; ++vi) { type t = static_cast(lua_geti(L, index, i + vi)); - if (t == type::lua_nil) { + isnil = t == type::lua_nil; + if (isnil) { if (i == 0) { - continue; - } - else { - lua_pop(L, (vi + 1)); - return arr; + break; } + lua_pop(L, (vi + 1)); + return arr; } } + if (isnil) + continue; arr.push_back(stack::get(L, -lua_size::value)); } #else // Zzzz slower but necessary thanks to the lower version API and missing functions qq for (lua_Integer i = 0; ; i += lua_size::value, lua_pop(L, lua_size::value)) { + bool isnil = false; for (int vi = 0; vi < lua_size::value; ++vi) { lua_pushinteger(L, i); lua_gettable(L, index); type t = type_of(L, -1); - if (t == type::lua_nil) { + isnil = t == type::lua_nil; + if (isnil) { if (i == 0) { - continue; - } - else { - lua_pop(L, (vi + 1)); - return arr; + break; } + lua_pop(L, (vi + 1)); + return arr; } } + if (isnil) + continue; arr.push_back(stack::get(L, -1)); } #endif