Closed Fancyapplebee closed 1 year ago
Can you be more specific? Although std::unordered_map
isn't Pythonized (something that can be fixed), begin()
and end()
seem to work fine and add is accessible. Example:
import cppyy
std = cppyy.gbl.std
m = std.unordered_map[std.string, std.string]()
for key, value in (("aap", "noot"), ("zus", "mies")):
m[key] = value
b = m.begin()
while b != m.end():
print(b.first, b.second)
b.__postinc__(1)
Pythonization has been added to repo.
Your solution worked! Thanks.
In CPPYY when you create a unordered_map there is no way to iterate over it in python. Because the add and sub dunders are not implemented the begin and end methods don't work.