2
0
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:
Dave Abrahams
2002-05-13 16:29:43 +00:00
parent 36be16b3e9
commit 673d857bd8

View File

@@ -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,