@@ -230,8 +230,19 @@ class class_ : public objects::class_base
230230 }
231231
232232 // Property creation
233- self& add_property (char const * name, object const & fget);
234- self& add_property (char const * name, object const & fget, object const & fset);
233+ template <class Get >
234+ self& add_property (char const * name, Get const & fget)
235+ {
236+ base::add_property (name, object (fget));
237+ return *this ;
238+ }
239+
240+ template <class Get , class Set >
241+ self& add_property (char const * name, Get const & fget, Set const & fset)
242+ {
243+ base::add_property (name, object (fget), object (fset));
244+ return *this ;
245+ }
235246
236247 template <class U >
237248 self& setattr (char const * name, U const & x)
@@ -367,20 +378,6 @@ inline class_<T,X1,X2,X3>::class_(char const* name, char const* doc, no_init_t)
367378 this ->def_no_init ();
368379}
369380
370- template <class T , class X1 , class X2 , class X3 >
371- inline class_<T,X1,X2,X3>& class_<T,X1,X2,X3>::add_property(char const * name, object const & fget)
372- {
373- base::add_property (name, fget);
374- return *this ;
375- }
376-
377- template <class T , class X1 , class X2 , class X3 >
378- inline class_<T,X1,X2,X3>& class_<T,X1,X2,X3>::add_property(char const * name, object const & fget, object const & fset)
379- {
380- base::add_property (name, fget, fset);
381- return *this ;
382- }
383-
384381namespace detail
385382{
386383 // This is an mpl BinaryMetaFunction object with a runtime behavior,
0 commit comments