[C++-sig] return object from factory function

David Abrahams dave at boostpro.com
Wed Jul 16 22:29:38 CEST 2008


on Wed Jul 16 2008, Gennadiy Rozental <rogeeff-AT-gmail.com> wrote:

> what I am end up doing is adding
> this statement:
>
> Py_INCREF( obj.ptr() );
>
> Is this right thing to do? 

Almost never

> Can I avoid C API somehow?

Usually.

Unfortunately I don't understand what you're doing well enough yet to be
able to advise.

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com



More information about the Cplusplus-sig mailing list