[C++-sig] Custom smart pointer with const Types

Jim Bosch talljimbo at gmail.com
Thu Oct 6 23:56:57 CEST 2011


On 10/06/2011 05:30 PM, Wichert Akkerman wrote:
> On 2011-10-5 19:00, Jim Bosch wrote:
>>
>> Personally, I pretty much always use shared_ptr, and I've written a
>> rather large extension to support constness on the Python side, and
>> dealing with shared_ptr<const T> is a side effect of that.
>>
>> I'm welcome to pass it on if you're interested, but I don't think it
>> really addresses your problem.
>
> I would be definitely be interested in seeing how you're handling const
> objects.
>

You can find a reasonable up-to-date version at

https://svn.boost.org/svn/boost/sandbox/python_extensions

There are a lot of other little extensions there too; you'll be most 
interested in the const_aware subdirectories.  It's highly likely the 
build system is broken, but the code itself should still work.  The best 
documentation is probably the const_aware example in the tests.

Adding this to Boost.Python proper is a big part of my plans for a 
Boost.Python v3, but that's still a ways off, and unfortunately the code 
I'm pointing you at may have suffered from a little bitrot as I haven't 
looked at it in a while.

Jim


More information about the Cplusplus-sig mailing list