Skip to content
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

Return multiple values from C++ to Lua #149

Open
shohnwal opened this issue Mar 21, 2016 · 1 comment
Open

Return multiple values from C++ to Lua #149

shohnwal opened this issue Mar 21, 2016 · 1 comment

Comments

@shohnwal
Copy link

While we all know it's possible that Lua functions can return multiple values to other Lua functions and Selene can return multiple values from Lua to C++ thanks to sel::Tie , is there any way with Selene to pass multiple values from C++ to Lua? The readme/manual doesn't say anything about that, it only mentions multi-value returns from Lua to C++.
If that's not possible at the moment, could a feature be added that we can use sel::Tie not only to recieve multiple-value data from Lua, but to also send multiple values from C++ to Lua? For example:
C++

sel::Tie<int,int,int> CoordinatePoint::getCoordinates() {
return sel::Tie(this->X, this->Y, this->Z);
}

and in Lua

a, b, c = cpp_getCoordinates()
-- calls previously registered returnCoordinates() C++ function
-- and sets a, b and c according to the sel::Tie returned from C++
@satoren
Copy link
Contributor

satoren commented Jul 29, 2016

std::tuple<int,int,int>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants