mirror of
https://github.com/boostorg/python.git
synced 2026-01-23 05:42:30 +00:00
Added setattr()
[SVN r13835]
This commit is contained in:
@@ -168,17 +168,14 @@ class class_ : public objects::class_base
|
||||
{
|
||||
ref fget(make_getter(pm));
|
||||
ref fset(make_setter(pm));
|
||||
this->add_property(name, fget, fset);
|
||||
return *this;
|
||||
return this->add_property(name, fget, fset);
|
||||
}
|
||||
|
||||
// Property creation
|
||||
self& add_property(char const* name, ref const& fget);
|
||||
self& add_property(char const* name, ref const& fget, ref const& fset);
|
||||
|
||||
|
||||
// return the underlying object
|
||||
// ref object() const; (implemented in base class)
|
||||
self& setattr(char const* name, ref const&);
|
||||
|
||||
private: // types
|
||||
typedef objects::class_id class_id;
|
||||
@@ -256,6 +253,13 @@ inline class_<T,X1,X2,X3>& class_<T,X1,X2,X3>::add_property(char const* name, re
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <class T, class X1, class X2, class X3>
|
||||
inline class_<T,X1,X2,X3>& class_<T,X1,X2,X3>::setattr(char const* name, ref const& x)
|
||||
{
|
||||
class_base::setattr(name, x);
|
||||
return *this;
|
||||
}
|
||||
|
||||
namespace detail
|
||||
{
|
||||
// This is an mpl BinaryMetaFunction object with a runtime behavior,
|
||||
|
||||
Reference in New Issue
Block a user