Skip to content

Migrating project from LuaBridge2 #83

Description

@rpatters1

I took a stab at migrating my project from LuaBridge2 to LuaBridge3. I ran into a couple of roadblocks:

  • After reading the fine manual, I do not see a non-intrusive option for a shared lifetime pointer of a class. The closest thing on offer appears to be std::shared_ptr, but it is not, in fact, non-intrusive. Per the manual, each such class has to derive std::enable_shared_from_this, unless I am missing something. Is there any reason I can't use RefCountedPtr from LuaBridge2? It seems like it should work without any changes.
  • After a brief mention in the executive summary at the top, CFunctions have no further mention in the manual. How do I register them in a namespace? The Namespace::addCFunction appears to be missing. (Or at least that's the error message I'm getting.)
  • When pushing return values on the Lua stack in a CFunction, I get an "ignoring return value of nodiscard function" warning. Ex.:
luabridge::Stack<bool>::push(L, returnVal);

What should I be doing with the return value? Or is there a more proper way to push values?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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