[C++-sig] custom smart pointer, vector_indexing_suite typeerror

Scott McKay skottmckay at gmail.com
Thu Jun 2 04:28:34 CEST 2005


After some experimentation/review I think this

> class_< X, X_Wrapper, boost::noncopyable, smart_ptr< X > >("X", init<>())
>     .def("run", pure_virtual(&X::run), return_self<>())
> ;

should be

class_<X,boost::noncopyable,smart_ptr<X_wrapper> >("X", init<>())
...

However doing so still results in a TypeError.

Now if I make it a vector of boost::shared_ptr<X>'s, I can append a
testX to it, so I'm thinking it may be due to the 'smart' pointer
class not being able to handle the conversion between X_Wrapper and X.

Could that be the case?

Thanks

S



More information about the Cplusplus-sig mailing list