I have the following:
void processData(const std::vector<int>& data); ... chai.add(chaiscript::fun(&processData), "processData");
To be able to use the function, I have also registered the vector type with:
Then, in the script, I can do the following:
auto data = StdVectorInt(); data.push_back(12); data.push_back(34); data.push_back(56); data.push_back(78); processData(data);
QUESTION: Is there any mechanism so that I could do the following instead?
processData([12, 34, 56, 78]);
I just wondering whether I could overload the
processData() function with some kind of
const Vector type.
EDIT: It seems that this could be as simple as
void processData(const std::vector<chaiscript::Boxed_Value>& data)
However, it feels that I’m dangerously assuming that the internal container type for ChaiScript’s vectors is
std::vector. Is there a
typedef anywhere to avoid making such assumption? That I have not been able to find.