[C++-sig] Assign ownership of Python-constructed object to C++ runtime

2012-04-16 Thread Adam Preble
I am pondering trying to eliminate some usages of shared pointers in my code since I have finally completed enough of it that I have good ownership rules for things in place. I still have one spot, which is basically the main door to the C++ runtime, where I have a problem. I've been creating ins

Re: [C++-sig] Define class in 2 scopes without re-exposing

2012-04-16 Thread John Reid
On 16/04/12 19:13, Dave Abrahams wrote: > > on Mon Apr 16 2012, John Reid wrote: > >> On 15/04/12 03:23, Dave Abrahams wrote: >>> >>> You can't do this; don't even try. Each C++ class has to have a unique >>> Python identity. If you just want to refer to the same class by a >>> different nam

Re: [C++-sig] Define class in 2 scopes without re-exposing

2012-04-16 Thread Dave Abrahams
on Mon Apr 16 2012, John Reid wrote: > On 15/04/12 03:23, Dave Abrahams wrote: >> >> You can't do this; don't even try. Each C++ class has to have a unique >> Python identity. If you just want to refer to the same class by a >> different name, you can of course: >> > >> BOOST_PYTHON_MODULE( _s

Re: [C++-sig] Define class in 2 scopes without re-exposing

2012-04-16 Thread Jim Bosch
On 04/16/2012 03:15 AM, John Reid wrote: On 15/04/12 03:23, Dave Abrahams wrote: You can't do this; don't even try. Each C++ class has to have a unique Python identity. If you just want to refer to the same class by a different name, you can of course: BOOST_PYTHON_MODULE( _sandbox ) { names

Re: [C++-sig] Define class in 2 scopes without re-exposing

2012-04-16 Thread John Reid
On 15/04/12 03:23, Dave Abrahams wrote: You can't do this; don't even try. Each C++ class has to have a unique Python identity. If you just want to refer to the same class by a different name, you can of course: BOOST_PYTHON_MODULE( _sandbox ) { namespace bp = ::boost::python; obj