[C++-sig] class properties for functions returning references

2008-11-27 Thread anirudh vij
Hi, I've been trying to make the following code work *class Bar{ public: Bar():_int(4){}; ~Bar(){}; int get() {return _int;} private: int _int; }; class Foo { public: Foo():_bar(Bar()){}; ~Foo(){}; Bar& get_bar(){return _bar;} private: Bar _bar; }; #include

Re: [C++-sig] class properties for functions returning references

2008-11-27 Thread Renato Araujo
Hi anirudh, Try something like that: ... .add_property("bar", make_function(&Foo::get_bar, return_value_policy()) ); I think "make_getter" is used to create access to members in the class. BR Renato 2008/11/27 anirudh vij <[EMAIL PROTECTED]>: > Hi, > > I've been trying to make the fol