[C++-sig] C++ copy construction and Python object copies

Stefan Seefeld stefan at seefeld.name
Fri May 29 16:28:46 CEST 2015


Hello,

Python's copy module allows for objects to be copied. The protocol for
this will look up special method __copy__. It seems to me that this
would trivially work for C++ objects providing a copy-constructor.
However, the copy-constructor isn't automatically bound to __copy__.
While I can certainly add that in user-code, I wonder why this isn't
done by Boost.Python itself.
Does anyone know the reasons for this ? Would it seem useful to add that
feature ?

		Stefan


-- 

      ...ich hab' noch einen Koffer in Berlin...



More information about the Cplusplus-sig mailing list