Re: [C++-sig] boost python class member getter/setter same name different only by constness

2014-10-03 Thread MM
On 3 October 2014 18:23, Jim Bosch wrote: > On Fri, Oct 3, 2014 at 1:15 PM, Stefan Seefeld > wrote: > >> On 2014-10-03 12:56, MM wrote: >> > yes i did that. >> > >> > class C { >> > public: >> > const std::string& get_name() const; >> > void set_name(const std::string&); >> >

Re: [C++-sig] boost python class member getter/setter same name different only by constness

2014-10-03 Thread Jim Bosch
On Fri, Oct 3, 2014 at 1:15 PM, Stefan Seefeld wrote: > On 2014-10-03 12:56, MM wrote: > > yes i did that. > > > > class C { > > public: > > const std::string& get_name() const; > > void set_name(const std::string&); > > private: > > std::string name_; > > }; > >

Re: [C++-sig] boost python class member getter/setter same name different only by constness

2014-10-03 Thread Stefan Seefeld
On 2014-10-03 12:56, MM wrote: > yes i did that. > > class C { > public: > const std::string& get_name() const; > void set_name(const std::string&); > private: > std::string name_; > }; > > > > class_("C"). > .add_property("name", &C::get_name, &C::se

Re: [C++-sig] boost python class member getter/setter same name different only by constness

2014-10-03 Thread MM
yes i did that. class C { > public: > const std::string& get_name() const; > void set_name(const std::string&); > private: > std::string name_; > }; > > class_("C"). > .add_property("name", &C::get_name, &C::set_name); this fails to compile because of unspecified call policies about

Re: [C++-sig] boost python class member getter/setter same name different only by constness

2014-10-03 Thread Stefan Seefeld
On 2014-10-02 16:09, MM wrote: > Hi > > class C { > public: > const std::string& name() const; > std::string& name(); > private: > std::string name_; > }; > > given this class C, how would I expose it to python with the class > property name? > > class_("C"). > .add_property("name", &C::n

[C++-sig] boost python class member getter/setter same name different only by constness

2014-10-03 Thread MM
Hi class C { public: const std::string& name() const; std::string& name(); private: std::string name_; }; given this class C, how would I expose it to python with the class property name? class_("C"). .add_property("name", &C::name, &C::name); or do I use 2 mem function pointers to di