2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-24 06:02:14 +00:00

Added missing add_property chaining

[SVN r13806]
This commit is contained in:
Dave Abrahams
2002-05-10 15:41:44 +00:00
parent ec3f5ff40b
commit 3328087de1

View File

@@ -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_<T,X1,X2,X3>::class_(char const* name)
, this->object());
}
template <class T, class X1, class X2, class X3>
inline class_<T,X1,X2,X3>& class_<T,X1,X2,X3>::add_property(char const* name, ref const& fget)
{
class_base::add_property(name, fget);
return *this;
}
template <class T, class X1, class X2, class X3>
inline class_<T,X1,X2,X3>& class_<T,X1,X2,X3>::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,