From: Adam N. <a.n...@sh...> - 2011-02-19 07:30:00
|
> I can't seem to figure out how to pass a Python dictionary to a C++ function > as an std::map object. > > Are there any examples showing how this is done? I can't seem to find any at all. Ok, well for anyone browsing the archives I think I figured it out. You can't just pass a Python dictionary to the function, but you can create a new Python object that looks like a dictionary, and pass that to your function instead. === %include <std_map.i> %module demo %template(NewMapInstance) ::std::map<TypeA, TypeB>; === temp = demo.NewMapInstance() demo.myfunc(temp) === Cheers, Adam. |