2020// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2121
2222// This file was generated with a script.
23- // Generated 2018-11-09 18:52:51.075276 UTC
24- // This header was generated with sol v2.20.4 (revision 1f90b04 )
23+ // Generated 2018-11-10 14:40:45.361811 UTC
24+ // This header was generated with sol v2.20.5 (revision a7048ae )
2525// https://github.com/ThePhD/sol2
2626
2727#ifndef SOL_SINGLE_INCLUDE_HPP
@@ -8247,12 +8247,12 @@ namespace stack {
82478247 }
82488248#endif // Do not allow strings to be numbers
82498249 int isnum = 0;
8250- const lua_Number v = lua_tonumberx(L, index, &isnum);
8251- const bool success = isnum != 0
82528250#if (defined(SOL_SAFE_NUMERICS) && SOL_SAFE_NUMERICS) && !(defined(SOL_NO_CHECK_NUMBER_PRECISION) && SOL_NO_CHECK_NUMBER_PRECISION)
8253- && static_cast<lua_Number>(llround(v)) == v
8251+ const lua_Number v = lua_tonumberx(L, index, &isnum);
8252+ const bool success = isnum != 0 && static_cast<lua_Number>(llround(v)) == v;
8253+ #else
8254+ const bool success = isnum != 0;
82548255#endif // Safe numerics and number precision checking
8255- ;
82568256 if (!success) {
82578257 // expected type, actual type
82588258#if defined(SOL_STRINGS_ARE_NUMBERS) && SOL_STRINGS_ARE_NUMBERS
@@ -14542,7 +14542,7 @@ namespace sol {
1454214542
1454314543 template <bool is_yielding, typename Fx, typename... Args>
1454414544 static void set_fx(lua_State* L, Args&&... args) {
14545- lua_CFunction freefunc = function_detail::call<meta::unqualified_t<Fx>, 2, is_yielding>;
14545+ lua_CFunction freefunc = detail::static_trampoline< function_detail::call<meta::unqualified_t<Fx>, 2, is_yielding> >;
1454614546
1454714547 int upvalues = 0;
1454814548 upvalues += stack::push(L, nullptr);
@@ -15512,6 +15512,19 @@ namespace sol {
1551215512 return static_cast<T>(std::forward<D>(otherwise));
1551315513 }
1551415514
15515+ template <typename T>
15516+ decltype(auto) get_or_create() {
15517+ return get_or_create<T>(new_table());
15518+ }
15519+
15520+ template <typename T, typename Otherwise>
15521+ decltype(auto) get_or_create(Otherwise&& other) {
15522+ if (!this->valid()) {
15523+ this->set(std::forward<Otherwise>(other));
15524+ }
15525+ return get<T>();
15526+ }
15527+
1551515528 template <typename K>
1551615529 decltype(auto) operator[](K&& k) const {
1551715530 auto keys = meta::tuplefy(key, std::forward<K>(k));
@@ -15562,6 +15575,13 @@ namespace sol {
1556215575 lua_State* lua_state() const {
1556315576 return tbl.lua_state();
1556415577 }
15578+
15579+ proxy& force() {
15580+ if (this->valid()) {
15581+ this->set(new_table());
15582+ }
15583+ return *this;
15584+ }
1556515585 };
1556615586
1556715587 template <typename Table, typename Key, typename T>
@@ -18280,6 +18300,9 @@ namespace sol {
1828018300#include <bitset>
1828118301
1828218302namespace sol {
18303+
18304+ struct usertype_metatable_core;
18305+
1828318306 namespace usertype_detail {
1828418307 const int metatable_index = 2;
1828518308 const int metatable_core_index = 3;
@@ -18291,7 +18314,7 @@ namespace sol {
1829118314 const int newindex_function_index = 4;
1829218315
1829318316 typedef void (*base_walk)(lua_State*, bool&, int&, string_view&);
18294- typedef int (*member_search)(lua_State*, void*, int);
18317+ typedef int (*member_search)(lua_State*, void*, usertype_metatable_core&, int);
1829518318
1829618319 struct call_information {
1829718320 member_search index;
@@ -18443,8 +18466,7 @@ namespace sol {
1844318466 return isnum != 0 && magic == toplevel_magic;
1844418467 }
1844518468
18446- inline int runtime_object_call(lua_State* L, void*, int runtimetarget) {
18447- usertype_metatable_core& umc = stack::get<light<usertype_metatable_core>>(L, upvalue_index(metatable_core_index));
18469+ inline int runtime_object_call(lua_State* L, void*, usertype_metatable_core& umc, int runtimetarget) {
1844818470 std::vector<object>& runtime = umc.runtime;
1844918471 object& runtimeobj = runtime[runtimetarget];
1845018472 return stack::push(L, runtimeobj);
@@ -18476,7 +18498,7 @@ namespace sol {
1847618498 }
1847718499 }
1847818500
18479- int runtime_new_index(lua_State* L, void*, int runtimetarget);
18501+ int runtime_new_index(lua_State* L, void*, usertype_metatable_core&, int runtimetarget);
1848018502
1848118503 template <typename T, bool is_simple>
1848218504 inline int metatable_new_index(lua_State* L) {
@@ -18575,8 +18597,7 @@ namespace sol {
1857518597 return indexing_fail<T, false>(L);
1857618598 }
1857718599
18578- inline int runtime_new_index(lua_State* L, void*, int runtimetarget) {
18579- usertype_metatable_core& umc = stack::get<light<usertype_metatable_core>>(L, upvalue_index(metatable_core_index));
18600+ inline int runtime_new_index(lua_State* L, void*, usertype_metatable_core& umc, int runtimetarget) {
1858018601 std::vector<object>& runtime = umc.runtime;
1858118602 object& runtimeobj = runtime[runtimetarget];
1858218603 runtimeobj = object(L, 3);
@@ -18781,7 +18802,7 @@ namespace sol {
1878118802 usertype_metatable& operator=(usertype_metatable&&) = default;
1878218803
1878318804 template <std::size_t I0, std::size_t I1, bool is_index>
18784- static int real_find_call(lua_State* L, void* um, int) {
18805+ static int real_find_call(lua_State* L, void* um, usertype_metatable_core&, int) {
1878518806 auto& f = *static_cast<usertype_metatable*>(um);
1878618807 if (is_variable_binding<decltype(std::get<I1>(f.functions))>::value) {
1878718808 return real_call_with<I1, is_index, true>(L, f);
@@ -18827,7 +18848,7 @@ namespace sol {
1882718848 }
1882818849 }
1882918850 if (member != nullptr) {
18830- return (member)(L, static_cast<void*>(&f), runtime_target);
18851+ return (member)(L, static_cast<void*>(&f), static_cast<usertype_metatable_core&>(f), runtime_target);
1883118852 }
1883218853 string_view accessor = stack::get<string_view>(L, keyidx);
1883318854 int ret = 0;
0 commit comments