diff --git a/include/boost/python/class.hpp b/include/boost/python/class.hpp index 8e921780..ae1705f6 100644 --- a/include/boost/python/class.hpp +++ b/include/boost/python/class.hpp @@ -172,8 +172,13 @@ class class_ : public objects::class_base return *this; } + // 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; +// ref object() const; (implemented in base class) private: // types typedef objects::class_id class_id; @@ -236,6 +241,21 @@ inline class_::class_(char const* name) , this->object()); } + +template +inline class_& class_::add_property(char const* name, ref const& fget) +{ + class_base::add_property(name, fget); + return *this; +} + +template +inline class_& class_::add_property(char const* name, ref const& fget, ref const& fset) +{ + class_base::add_property(name, fget, fset); + return *this; +} + namespace detail { // This is an mpl BinaryMetaFunction object with a runtime behavior,