-
Notifications
You must be signed in to change notification settings - Fork 20
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
Does LuaGlue support default parameters? #68
Comments
Due to the way call's are generated at compile time, it may not work. but please test it if you can. I've had some ideas on how to make it work (if it doesn't). |
It looks like no, as is it isn't supported. The magic C++ template magic is not able to detect default arguments. I'm not actually sure how to support variable number of arguments at the moment because of the way we bind to functions using stored function pointers that pull their type from the passed function. I have an idea, but i'm not sure if it'll actually work. I will try to implement it, but I give no guarantees. |
Yet you know how many arguments you have in the lua stack. On Wed, Sep 3, 2014 at 9:02 PM, Thomas Fjellstrom [email protected]
Jean-Marc Le Roux Founder and CEO of Aerys (http://aerys.in) Blog: http://blogs.aerys.in/jeanmarc-leroux |
Yes, we do know how many items are in the stack when our internal call method is called, the main problem is when storing function pointers, they store ALL of the parameters as part of the function pointer type, not just the required ones. So we actually have to pass ALL of the parameters or the compiler will complain when we try to call the function through that function pointer. A separate set of code that stores the function pointer as a var-arg function pointer might work, but thats a bunch of code duplication, and may be less safe. I'm also not convinced it'll end up working properly either. |
I have the method:
CameraPtr is shared_ptr
Will this work and can I omit default params in Lua?
The text was updated successfully, but these errors were encountered: