You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a 5 pair multimap but when I try to pass it back from C++ to lua, it swallows the duplicate key pairs and gives me a map with just 3 values.
See https://godbolt.org/z/6zcbM5znj to try it.
This is probably because we recognize this is some kind of map, but don't acknowledge things that overwrite previous inserts. (Tables in Lua get built up by just inserting one value after the next.) I'll need to add a new-ish category of detection for multimap types, then perform the insertions....
One problem we're going to have here is how we make a multimap in Lua, and what the API for the table looks like. The conversion between and map and a multimap is going to be pretty brutal, and the performance metrics will drop heavily if we do something like e.g. make every pushed value a table even if there's only 1 value to that key. We might have to have a mix of single values and table values, but this will definitely complicate people's usage of the API.
I have a 5 pair multimap but when I try to pass it back from C++ to lua, it swallows the duplicate key pairs and gives me a map with just 3 values.
See https://godbolt.org/z/6zcbM5znj to try it.
Program output is:
I was expecting the values of a multimap to be a table or vector
The text was updated successfully, but these errors were encountered: