Re: [C++-sig] Trouble destructor, call python's object with pointer in boost.python

2012-12-22 Thread Jaedyn K. Draper
No problem! On 12/22/2012 5:08 PM, simon zhang wrote: You are right.Thank you. 2012/12/23 Jaedyn K. Draper > If you pass it to a function like that, it passes it by value even if it's a pointer. So it's calling the copy constructor (which you haven'

Re: [C++-sig] Trouble destructor, call python's object with pointer in boost.python

2012-12-22 Thread simon zhang
You are right.Thank you. 2012/12/23 Jaedyn K. Draper > If you pass it to a function like that, it passes it by value even if > it's a pointer. So it's calling the copy constructor (which you haven't > defined so it isn't printing "A start"), rather than the regular > constructor, and then destr

Re: [C++-sig] Trouble destructor, call python's object with pointer in boost.python

2012-12-22 Thread Jaedyn K. Draper
If you pass it to a function like that, it passes it by value even if it's a pointer. So it's calling the copy constructor (which you haven't defined so it isn't printing "A start"), rather than the regular constructor, and then destructing it. To pass an actual pointer rather than sending it

[C++-sig] Trouble destructor, call python's object with pointer in boost.python

2012-12-22 Thread simon zhang
when I call python's function with pointer as an argument in boost.python, there are some troubles in destructor. The following is a sample code #include #include #include #include #include using namespace boost::python; class A {public: A() { std::cout<< "A start"< ("A",init<>())