nim-lang / c2nim

c2nim is a tool to translate Ansi C code to Nim. The output is human-readable Nim code that is meant to be tweaked by hand before and after the translation process.
MIT License
509 stars 63 forks source link

Better handling of CPP static methods #263

Closed Menduist closed 1 year ago

Menduist commented 1 year ago
class ClassA
{
  public:
    static void test();
};

Now becomes

proc test*(_: `type` ClassA) {.importcpp: "ClassA::test(@)",
                               header: "cppstatic.hpp".}

(notice the added type ClassA parameter) which can be used by doing ClassA.test()

Araq commented 1 year ago

Awesome, but it needs a switch so that it can be enabled. Backwards compat is important.