[pygccxml-development] Indexing suite and Python containers
Brought to you by:
mbaas,
roman_yakovenko
From: Berserker <ber...@ho...> - 2010-01-19 08:37:45
|
I'm exposing some containers with indexing suite 2, in particular: std::map<std::string, std::string>, std::vector<std::string> and std::list<std::string> The manipulation of the containers works fine, I mean get the container from C++ and work on it. The only "problem" I have found is when I need to pass a container to a C++ function, for example: void foo(const std::map<std::string, std::string> &m); In Python I expected that I could write: m = { "1":"2", "3":"4"} foo(m) The above code doesn't works because I need to write: m = std_map_std_string_to_std_string() m["1"] = "2" m["3"] = "4" foo(m) My question is: do I need to write a specific converter for each C++ container or is there a quicker solution to enable the automatic conversion from Python containers to C++ containers? Shouldn't indexing_suite do automatically this job? _________________________________________________________________ Velocità, sicurezza e...tanto spazio! Scopri le novità di Hotmail http://www.windowslive.it/hotmail/Home_novita.aspx |