logo       

Smartpointer and references: msg#00177

programming.swig

Subject: Smartpointer and references

i'm having a usual smartpointer class, let's call it "SmartPtr".

then i have

class Foo;
typedef SmartPtr<Foo> FooPtr;

class Foo
{
static Foo *instance;
public:
static RESULT getInstance(FooPtr &ptr) { ptr = instance; return 0; } /*... plus error checking */
};

Now i'd like to use something like

instance = FooPtr()
Foo.getInstance(instance)

in python, but i get

"TypeError: Expected a pointer" on the "getInstance" call.

Is there something special to account when using references at all?

Felix

_______________________________________________
Swig maillist - Swig@xxxxxxxxxxxxxxx
http://mailman.cs.uchicago.edu/mailman/listinfo/swig



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise