-
Notifications
You must be signed in to change notification settings - Fork 117
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
passing std::string ref from lua to c++ function #66
Comments
Can you try changing the function signature to const std::string& and see if it still happens? |
changing the function signature from std::string& to std::string fixes the issue. It happens to be a 3rd partly library I'm trying to wrap, so I was trying to avoid modifying it. But it's not a huge deal. Thanks for your quick response. |
Well I think this might be a bug since I am handling functions with parameter type "const std::string &" in a special way. Again, does the adding the |
sorry I didn't state this previously; the function argument is specifically "const std::string&". When called from lua I'm seeing just an empty string passed in. Changing the argument to pass by value rather than reference fixes the issue. |
Looks like I have tests for returning strings from class member functions but not sending them :P. Let's leave this open in case I have time to address it and add a new test case. Thanks! |
great, thanks for the help, maybe I'll try sometime as well just to give myself a sanity check |
I'm calling a c++ class member function from lua that has a std::string& argument. Once called an empty string is passed in. The correct string is passed in if I change the function's argument to accept std::string rather than std::string&. Is there any way around this by registering std::string somehow?
The text was updated successfully, but these errors were encountered: