Boost logo

Boost Users :

Subject: [Boost-users] Python embedding - vector problem
From: Tyomich on the AIR (cadchrk_at_[hidden])
Date: 2009-07-01 03:07:46


Hello! I'm currently embedding Python in C++ and now having some problems with std::vector.
I used indexing suite to wrap it and work with it in Python like a Python list. But there is a problem: when I copy it in Python style (e.g. a[:] = b) it seems like it copies elements recursively, here is a log of copying:

Copy constructor
Copy constructor
Destructor
Copy constructor
Copy constructor
Copy constructor
Destructor
Destructor
Copy constructor
Copy constructor
Copy constructor
Copy constructor
Destructor
Destructor
Destructor
..

This is a real problem when the number of elements is more than 100000, because it takes a long time to finish. Is there anything to do with it?

Regards, Chirkov Artyom


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net