31.12.2017, 14:59
(
Last edited by ShapeGaz; 01/01/2018 at 08:37 PM.
)
Quote:
You should allow all of the following (<key, value>):
<string, int> <string, string> <int, string> <int, int> This would be very useful if you could make it more complete: 1. allow the scripter to set load factor, bucket count, etc. 2. set function which works like try_emplace 3. set function which sets iff the key exists |
PHP Code:
// Get int value
new map:map = map_new();
map_emplace(map,"12","14");
new value[2];
map_find(map,"12",value,sizeof(value));
new intvalue = strval(value);
// Emplace int value
new value[2];
format(value,sizeof(value),"%d",10); // With the key you can do the same
map_emplace(map,"test",value);
2. I'll add to the next updates
3. What? Explain pls