Skip to content

std::bind_front etc. with luabridge::newFunction and addFunction #231

@skrat

Description

@skrat

It would be nice if luabridge::newFunction and addFunction would support the return value of std::bind, std::bind_front or a lambda with forwarded arguments, eg.:

luabridge::newFunction(L, std::bind_front(lua_draw_string, canvas));
  ns["draw_string"] = luabridge::newFunction(
      L, [&canvas](auto&& ...  args) {
        lua_draw_string(canvas, std::forward<decltype(args)>(args)...);
      });

I might be completely wrong here and something like this is not possible with C++ (17+).

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