-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
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
Failures after #338 #400
Comments
It's true that it would be good to have an easy option to re-enable this behavior. If I understand correctly you want something like this: struct World
{
World(const std::string& message = "default hello") : msg(message){}
const std::string& greet() const { return msg; }
};
JLCXX_MODULE define_julia_module(jlcxx::Module& types)
{
types.add_type<World>("World")
.constructor<const std::string&>()
.method("greet", &World::greet);
} Where it should be possible to call |
Yes, that's roughly the case. In the original PR, the author describes the fixes as "easy enough", but I can't figure out a design pattern that doesn't require me to just wrap this function a second time. |
Luckily, my design pattern will always have the shared pointer as the first argument (to kinda go along with Julia syntax), so a quick-and-dirty fix here is
where
Beware all ye who enter: this could easily cause issues with ambiguous function definitions. |
Hi! I'm generally a happy user of this package, and really appreciate the hard work put into it. I maintain a library depending on CxxWrap that generally interfaces with its objects via
shared_ptr
s. As such, a large swath of the library relied on the automatic conversion from smart pointers to references that was removed in #338 (I realized there were issues with upgrading from 0.12 to 0.13 awhile ago, but haven't had the chance to fix them until I've been forced to with 1.10 issues).Is there any suggested way of having a type signature
foo(bar::CxxWrap.StdLib.SharedPtr{T}, args...)
and resolving that in C++ asbar->foo(args...)
wherebar
is of typeshared_ptr<T>
? A significant amount of my library relies on this and, while I believe I could make a Julia macro to generate this code, it would either be overly simplistic or take a huge amount of time to make.Any thoughts and advice are appreciated!
The text was updated successfully, but these errors were encountered: