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&);
>> >
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_;
> > };
> >
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
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
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
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