I have some C++ methods that have std::set<std::string>
as argument or return value.
I would like to map this to a Python frozenset
(or regular set
) but there does not seem to be a straightforward way to do this.
Does anyone know how one may accomplish this task.
Or you can use std::map<YourType, int>
instead of std::set<YourType>
, the value can be for example 0. std::map has the same insert/search time complexity as std::set, it also keeps the keys ordered, it will only bloat the memory a little. Then you can use map indexing suite and in python you can hide the difference in some wrapper class if needed. The disanvantage is that you have to modify your existing c++ code a little bit.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With