You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The reason it works differently for a member function is to facilitate applying a member function to both pointers and references (since Julia has no concept of member functions, and in C++ there is no overloading with respect to the owning object). For free functions on the other hand, a C++ library may provide different overloads taking pointers or references, so we can't just automate this.
The two options are:
Add an overload for references (or even shared pointers): types.method("GetTemplate", [](DataBase& db, const std::string &name)
Get the normal pointer: templ = GetTemplate(CxxPtr(db[]), "")
Hi!
Is it possible to take pointer from shred_ptr in julia?
I found the following behaviour:
Here is a binded class:
Lets return raw pointer to
DataBase
:its ok.
Let return stdL::shared_ptr
i got error trying to pass
shared_ptr[]
to non member function taking pointer.Its obvious that
operator[]
return reference and there is internal workaround for members.Is it possible to get it work same way for member and non member functions? (Could i add some function taking pointer from shared_ptr?)
(i have a lot of function taking pointers, and get 20% slow down on simple functions taking reference)
Thanks!
The text was updated successfully, but these errors were encountered: