how to deal with static c++ object

2005-09-13 Thread Dongxu Ma
Hi all, In some case, a class will have a static object for special purpose. For instance: static foo foo::bar I want to port this object to perl by wrapping it as a sub like this: foo * foo::bar() CODE: RETVAL = (foo::bar); OUTPUT: RETVAL This will always cause a segfault while invoking the

Re: how to deal with static c++ object

2005-09-13 Thread David Nicol
Dongxu: please refer to http://inline.perl.org/inline/home.html On 9/13/05, Dongxu Ma [EMAIL PROTECTED] wrote: I want to port this object to perl by wrapping it as a sub like this: Another question, is there any better way to port a class method which

Re: how to deal with static c++ object

2005-09-13 Thread Nicholas Clark
On Tue, Sep 13, 2005 at 03:08:51PM +0800, Dongxu Ma wrote: Hi all, Another question, is there any better way to port a class method which returns an object. Like this: foo foo::bar2() since the returned object is local, which is usually allocated on stack, I have to new an object on

Re: how to deal with static c++ object

2005-09-13 Thread Dave Mitchell
On Tue, Sep 13, 2005 at 03:08:51PM +0800, Dongxu Ma wrote: In some case, a class will have a static object for special purpose. For instance: static foo foo::bar I want to port this object to perl by wrapping it as a sub like this: foo * foo::bar() CODE: RETVAL = (foo::bar); OUTPUT: