[C++-sig] Re: using object constructor

David Abrahams david.abrahams at rcn.com
Fri Jun 21 20:40:05 CEST 2002


----- Original Message -----
From: "Dave Hawkes" <daveh at cadlink.com>
Newsgroups: gmane.comp.python.c++
To: <c++-sig at python.org>
Sent: Friday, June 21, 2002 2:29 PM
Subject: [C++-sig] Re: using object constructor


>
> "David Abrahams" <david.abrahams at rcn.com> wrote in message
> news:147401c2194e$aa1bb040$6601a8c0 at boostconsulting.com...
> >
> > From: "Dave Hawkes" <daveh at cadlink.com>
> >
> > > If we want to start wrapping a significant number of functions to
return
> > > objects is this the best way to do it as it seems inherently unsafe
as
> > > almost any type of pointer return could be cast in this way.
> >
> > It's an implementation detail, not for public consumption.
> >
>
> So what's the recommended public method, is it
> object(handle<>(my_py_object_ptr)) ?

Yep.

> > > Is there any reason why a new template class like borrowed but called
> > > (possibly) new_pyobject was not used?
> >
> > It adds complication and overhead in debug builds.
> >
>
> I don't think it would need all the additional support borrowed entails,
but
> I haven't checked in depth.

How could it be less?
Well, I'm willing to consider a patch with concrete code, as previously
stated.

Thanks again,
Dave







More information about the Cplusplus-sig mailing list