On 02/24/2012 05:44 AM, Holger Joukl wrote:
> Just for the record, this is what I do now:
>
> inline
> bool isMyExtensionClass(PyObject* &pyobj) {
>     bp::extract<MyExtensionClass&> extractor(pyobj);
>     return extractor.check();
> }

I'm not sure why you use raw PyObject pointers in the first place. That
should all be hidden behind bpl::object instances (which will then take
care of the ref counting business for you).


> inline
> bool isMyExtensionClass(bp::object &obj) {
>     bp::extract<MyExtensionClass&> extractor(obj);
>     return extractor.check();
> }

bp::object itself has reference (smart pointer) semantics, so there is
no need to pass objects by reference.

    Stefan


-- 

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

_______________________________________________
Cplusplus-sig mailing list
Cplusplus-sig@python.org
http://mail.python.org/mailman/listinfo/cplusplus-sig

Reply via email to