-
-
Notifications
You must be signed in to change notification settings - Fork 580
Closed
Description
I got following error when using sol::light
/.../sol2/include/sol/stack_push.hpp:655:29: error: invalid ‘static_cast’ from type ‘<unresolved overloaded function type>’ to type ‘void*’
655 | lua_pushlightuserdata(L, static_cast<void*>(l.value));
|
After diving the source code, I found inconsistency on unqualified_pusher<light<T>>. The unqualified_pusher<light<T>> is using light<T>.value as a pointer, but in light<T>'s definition, light<T>.valule is a function returning a pointer.
sol2/include/sol/stack_push.hpp
Lines 649 to 658 in 6409634
| template <typename T> | |
| struct unqualified_pusher<light<T>> { | |
| static int push(lua_State* L, light<T> l) noexcept { | |
| #if SOL_IS_ON(SOL_SAFE_STACK_CHECK_I_) | |
| luaL_checkstack(L, 1, detail::not_enough_stack_space_generic); | |
| #endif // make sure stack doesn't overflow | |
| lua_pushlightuserdata(L, static_cast<void*>(l.value)); | |
| return 1; | |
| } | |
| }; |
Lines 236 to 238 in 6409634
| T* value() const { | |
| return m_value; | |
| } |
Metadata
Metadata
Assignees
Labels
No labels