Boost logo

Boost :

From: conversy_at_[hidden]
Date: 2001-09-06 09:19:36


Hello.

If I have that struct:

struct A {
  int field;
  int& getField() { return field; }
  A() : field(0) {}
};
what should I do to allow this kind of python code (if possible):

from whatever import *

a=A()
f = a.getField()
f = 1
print a.getField()

currently this code prints "0", but I want it to print "1"...
is it possible ?

thanks,

  stef

btw, how can I tell to python not to destroy a particular object when
this object is owns by my own library ?


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk