How to associate a C ++ function with lua that returns multiple values ​​with luabind?

Is it possible to use the following function using luabind?

void retByRef(int &a, int& b) { a = 10; b = 10 } 

I tried to do the following, but only works with functions that have one parameter

 def("retByRef", &retByRef, pure_out_value(_1)) 

Is there a way to specify a policy for each setting?

+4
source share
1 answer

Ok, I found a + operator that can be used to add policies, so

 def("retByRef", &retByRef, pure_out_value(_1) + pure_out_value(_2)) 
+6
source

Source: https://habr.com/ru/post/1496457/


All Articles