We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible to bind multiple constructors with this library? I've tried doing it with the following sample code without success.
class test { public: test(const std::string& arg1) { std::cout << std::format("{}\n", arg1); } test(const std::string& arg1, const std::string& arg2) { std::cout << std::format("{}, {}\n", arg1, arg2); } }; int main(int argc, char* argv[]) { auto vm = wren::VM(); auto& example = vm.module("example"); auto& lib = example.klass<test>("test"); lib.ctor<const std::string&>(); lib.ctor<const std::string&, const std::string&>(); try { vm.runFromSource("main", R"( import "example" for test var test1 = test.new("1") var test2 = test.new("1", "2") )"); } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } return 0; }
Runtime error: test metaclass does not implement 'new(_)'. at: main:4
The text was updated successfully, but these errors were encountered:
Unfortunately only one constructor can be specified at the moment.
Some alternatives that I can suggest:
Sorry, something went wrong.
No branches or pull requests
Is it possible to bind multiple constructors with this library? I've tried doing it with the following sample code without success.
The text was updated successfully, but these errors were encountered: