Fingers crossed someone can help me,
I am working on the last phase of my project, long story short, I am trying to get Lua values from a table back into JavaScript.
Like JavaScript, Lua is dynamically typed, I am going to be puting all sorts of values into a c++ std::map
specification for this map:
- keys can be double or string
- values can be, boolean, string, null, double and map of the same type (recursive)
For simplicity and your sake I have reduced this down somewhat.
std::variant<std::string, int> returnsAllSorts (){
return stringOrInt(); // this could return either or.
}
EMSCRIPTEN_BINDINGS (my_module) {
emscripten::function("returnsAllSorts", &returnsAllSorts);
}
If the above wont work, what else can I try, in order to get a map with different values?