8000 sol::light compile error · Issue #1354 · ThePhD/sol2 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
sol::light compile error #1354
Closed
Closed
@qinix

Description

@qinix

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.

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;
}
};

sol2/include/sol/types.hpp

Lines 236 to 238 in 6409634

T* value() const {
return m_value;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0