Leont/libperl--

multiple constructors support

Closed this issue · 1 comments

We've tried to use the library with multiple constructors on the c++ end to no avail.

It seems like only the last one registered is taken into account.

Would it be possible for multiple function definitions to be supported? I guess it is just a matter of mapping.

Thanks.

Actually, that is supported already as long as the constructors have different names.

Class<Foo> foo = universe.add_class("Foo");
foo.add("new_from_int", init<int>());
foo.add("new_from_string", init<std::string>());

If you prefer that, you can add a new method in Perl that choses between them.