| 406 | } |
| 407 | |
| 408 | template <typename C> int containerIndexInteger(lua_State *L) |
| 409 | { |
| 410 | C **v = (C **)lua_touserdata(L, 1); |
| 411 | int i = luaL_checkinteger(L, 2); |
| 412 | lua_settop(L, 0); |
| 413 | --i; // lua indices start at 1 |
| 414 | if (i >= 0 && i < (*v)->size()) |
| 415 | { |
| 416 | pushToLua(L, (*v)->operator[](i)); |
| 417 | } |
| 418 | else |
| 419 | { |
| 420 | lua_pushnil(L); |
| 421 | } |
| 422 | return 1; |
| 423 | } |
| 424 | template <typename C> int containerIndexMap(lua_State *L) |
| 425 | { |
| 426 | C **v = (C **)lua_touserdata(L, 1); |
nothing calls this directly
no test coverage detected