I need to port an existing C++ library to Java. In the C++ code there is a factory method:
std::shared_ptr<Role> createRole(std::string name)
which will return a nullptr
if it was not possible to create the Role.
Unfortunately if I try to port this code with SWIG it will fail silently at this point. I guess that is because Java doesn't know about nullptr
and SWIG is most likely ignoring it. Is my assumption right? Because I'm originally a Java developer and don't know much about SWIG and C++...
Sadly I can't change the existing C++ code. Is there any workaround for this? Or will I have to write a Wrapper for this special case? This problem occures in 4 or 5 places in the project.