[C++-sig] copy.deepcopy of a vector, and the resulting error

Hans Meine meine at informatik.uni-hamburg.de
Wed Feb 6 09:44:44 CET 2008

Am Mittwoch, 06. Februar 2008 08:42:43 schrieb Roman Yakovenko:
> 2008/2/5 Matthew Scouten <matthew.scouten at gmail.com>:
> > So I have a vector of foo that I exposed with the indexing suite, and I
> > need to deepcopy it. I get a Boost.Python.ArgumentError exception when I
> > try to iterate across the result later.
> I tried your example using indexing suite 2 and it gave me nice & very
> helpful error message:
> RuntimeError: Pickling of "deepcopy.items_t" instances is not enabled
> (http://www.boost.org/libs/python/doc/v2/pickle.html)
> Take a look on the URL.

Also have a look in the archives for the "How about 
class_<...>.enable_copy() ?" thread, if you want explicit __deepcopy__ 
instead of using the pickle protocol.

Ciao, /  /
    /  / ANS

More information about the Cplusplus-sig mailing list