Re: [C++-sig] shared_ptr object identity

2010-08-16 Thread Erlend Cleveland
> Do I understand correctly that you want to use the object essentially like > a dictionary, just with obj.key instead of obj["key"]? > I consider this bad practice, since it isn't obvious to readers of your > code. Yes, you make a good point here, and it has made me question the use cases that I

Re: [C++-sig] shared_ptr object identity

2010-08-16 Thread Ralf W. Grosse-Kunstleve
Hi Earl, > > Do I understand correctly that you want to use the object essentially like > > a dictionary, just with obj.key instead of obj["key"]? > > I consider this bad practice, since it isn't obvious to readers of your > > code. > > Yes, you make a good point here, and it has made me question

[C++-sig] Python __init__ that copies internal reference, boost.python

2010-08-16 Thread Branan Purvine-Riley
I'm working on replacing hand-rolled python bindings with boost.python. Unfortunately, I've hit a bit of a snag at a particular construct: a = someFunction(...) # returns an instance of myClass b = myClass(a) In the current bindings, this creates a new python object that references the same

Re: [C++-sig] Python __init__ that copies internal reference, boost.python

2010-08-16 Thread Jim Bosch
On 08/16/2010 02:33 PM, Branan Purvine-Riley wrote: I'm working on replacing hand-rolled python bindings with boost.python. Unfortunately, I've hit a bit of a snag at a particular construct: a = someFunction(...) # returns an instance of myClass b = myClass(a) In the current bindings, thi

Re: [C++-sig] Python __init__ that copies internal reference, boost.python

2010-08-16 Thread Branan Purvine-Riley
On Monday 16 August 2010 14:49:04 Jim Bosch wrote: > On 08/16/2010 02:33 PM, Branan Purvine-Riley wrote: > > I'm working on replacing hand-rolled python bindings with boost.python. > > > > Unfortunately, I've hit a bit of a snag at a particular construct: > >a = someFunction(...) # returns an

Re: [C++-sig] Python __init__ that copies internal reference, boost.python

2010-08-16 Thread Jim Bosch
On 08/16/2010 04:21 PM, Branan Purvine-Riley wrote: That's definitely on the right track. Not quite right because of some of the oddities of what I'm working with here. It's a game engine, and none of the pointers are stored in a smart pointer container of any kind. Unfortunately make_constructo