[C++-sig] Runtime errors after trying to use debug Python build with Boost.Python

2012-02-12 Thread Adam Preble
I am trying to use Python with debug symbols so I can peak into it when I get runtime errors related to Boost.Python wrappers. I can't seem to get this to work. I think this is more a building thing than anything else so I figure I'd share what I've done: 1. Acquire the source for Stackless Pyth

Re: [C++-sig] boost python and boost/thread.hpp

2012-02-12 Thread Jim Bosch
On 02/12/2012 01:34 PM, Guillaume Carbonneau wrote: Hi, I'm having compilation errors as soon as I give my classes member variables that come from the boost thread library. Wrapping those in shared_ptr seems to work. Any idea why? Is there a special wrapping directive I should give it to? Th

Re: [C++-sig] boost python and boost/thread.hpp

2012-02-12 Thread Stefan Seefeld
On 02/12/2012 01:34 PM, Guillaume Carbonneau wrote: > Hi, > > I'm having compilation errors as soon as I give my classes member > variables that come from the boost thread library. > Wrapping those in shared_ptr seems to work. By default, boost.python treats objects as copyable. That doesn't work

Re: [C++-sig] boost python & context manager/with statement

2012-02-12 Thread Jim Bosch
On 02/12/2012 01:25 PM, Avi Bahra wrote: Does boost python support context management using the with statement? In my case I need to manage __enter__/__exit__ on the c++ side. Could not find any examples for this in the documentation. Do you mean that you want to create an object that *has* _

[C++-sig] boost python and boost/thread.hpp

2012-02-12 Thread Guillaume Carbonneau
Hi, I'm having compilation errors as soon as I give my classes member variables that come from the boost thread library. Wrapping those in shared_ptr seems to work. Any idea why? Is there a special wrapping directive I should give it to? #include #include #include struct Hello { Hello(){}

Re: [C++-sig] boost::python handles boost::shared_ptr specially...

2012-02-12 Thread Jim Bosch
On 02/12/2012 01:01 PM, VáclavŠmilauer wrote: Will std::shared_ptr just work also? I asked this question some time ago here: http://stackoverflow.com/questions/6568952/c0x-stdshared-ptr-vs-boostshared-ptr To summarize: you need to define free get_pointer functions for T=your shared_ptr type an

[C++-sig] boost python & context manager/with statement

2012-02-12 Thread Avi Bahra
Does boost python support context management using the with statement? In my case I need to manage __enter__/__exit__ on the c++ side. Could not find any examples for this in the documentation. Any help appreciated. Best regards, Ta,     Avi ___ Cplusp

Re: [C++-sig] from-python converter for aligned class

2012-02-12 Thread Jim Bosch
On 02/12/2012 12:49 PM, Václav Šmilauer wrote: I wrote a custom to-python converter for an aligned struct (It is a 128-bit aligned vector type from the http://eigen.tuxfamily.org library). I followed http://www.boost.org/doc/libs/1_39_0/libs/python/doc/v2/faq.html#custom_string), the converter lo

Re: [C++-sig] Boost converter for passing std::vector object by reference into a function??

2012-02-12 Thread VáclavŠmilauer
> One could imagine writing a fancy converter that would allow the first > form by making a temporary std::vector, passing that to the C++ > function, and then copying the elements in the vector back into the > Python list. But that's potentially a very expensive sequence of > operations, and

Re: [C++-sig] boost::python handles boost::shared_ptr specially...

2012-02-12 Thread VáclavŠmilauer
> Will std::shared_ptr just work also? I asked this question some time ago here: http://stackoverflow.com/questions/6568952/c0x-stdshared-ptr-vs-boostshared-ptr To summarize: you need to define free get_pointer functions for T=your shared_ptr type and it will work. I eventyallu did not go that way

[C++-sig] from-python converter for aligned class

2012-02-12 Thread Václav Šmilauer
I wrote a custom to-python converter for an aligned struct (It is a 128-bit aligned vector type from the http://eigen.tuxfamily.org library). I followed http://www.boost.org/doc/libs/1_39_0/libs/python/doc/v2/faq.html#custom_string), the converter looks like this: class AlignedType{ /*...