@@ -301,15 +301,40 @@ class class_ : public objects::class_base
301301 }
302302
303303 // Property creation
304+ private:
304305 template <class Get >
305- self& add_property (char const * name, Get fget, char const * docstr = 0 )
306+ self& add_property_impl (char const * name, Get fget, char const * docstr, int )
306307 {
307308 base::add_property (name, this ->make_getter (fget), docstr);
308309 return *this ;
309310 }
310311
311312 template <class Get , class Set >
312- self& add_property (char const * name, Get fget, Set fset, char const * docstr = 0 )
313+ self& add_property_impl (char const * name, Get fget, Set fset, ...)
314+ {
315+ base::add_property (
316+ name, this ->make_getter (fget), this ->make_setter (fset), 0 );
317+ return *this ;
318+ }
319+
320+ public:
321+ template <class Get >
322+ self& add_property (char const * name, Get fget)
323+ {
324+ base::add_property (name, this ->make_getter (fget), 0 );
325+ return *this ;
326+ }
327+
328+ template <class Get , class DocStrOrSet >
329+ self& add_property (char const * name, Get fget, DocStrOrSet docstr_or_set)
330+ {
331+ this ->add_property_impl (name, this ->make_getter (fget), docstr_or_set, 0 );
332+ return *this ;
333+ }
334+
335+ template <class Get , class Set >
336+ self&
337+ add_property (char const * name, Get fget, Set fset, char const * docstr)
313338 {
314339 base::add_property (
315340 name, this ->make_getter (fget), this ->make_setter (fset), docstr);
0 commit comments