How to bind a C++ function to lua that return multiple values with luabind?

StackOverflow https://stackoverflow.com/questions/18176330

  •  24-06-2022
  •  | 
  •  

Вопрос

It is possible, using luabind, to bind the following function?

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

I was trying the following, but it is only working with functions that has one parameter

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

There is way to specify a policy for each parameter?

Это было полезно?

Решение

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

def("retByRef", &retByRef, pure_out_value(_1) + pure_out_value(_2))
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top