[C++-sig] Re: strange class_.def behaivior

Mike Rovner mike at nospam.com
Fri Oct 10 03:47:29 CEST 2003


Never mind. It was python object garbage collected.
In this case class_ object itself, not reference must be returned.

Mike

Mike Rovner wrote:
>   static class_<T>& PyClass(const char* name)
                                   ^^^ drop &
>   {
>     return
>     class_<T>(name)
>       .def(init<int>())
>       .def("__len__", &T::Size)
>       ;
>   }







More information about the Cplusplus-sig mailing list