From 424f5bdf31a3bce14f6cef3f1513d95c192fd1c3 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Mon, 16 May 2005 17:34:46 +0000 Subject: [PATCH] Workarounds for vc6 and 7. [SVN r28973] --- include/boost/python/class.hpp | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/include/boost/python/class.hpp b/include/boost/python/class.hpp index 0928c398..2753267d 100644 --- a/include/boost/python/class.hpp +++ b/include/boost/python/class.hpp @@ -301,15 +301,40 @@ class class_ : public objects::class_base } // Property creation + private: template - self& add_property(char const* name, Get fget, char const* docstr = 0) + self& add_property_impl(char const* name, Get fget, char const* docstr, int) { base::add_property(name, this->make_getter(fget), docstr); return *this; } template - self& add_property(char const* name, Get fget, Set fset, char const* docstr = 0) + self& add_property_impl(char const* name, Get fget, Set fset, ...) + { + base::add_property( + name, this->make_getter(fget), this->make_setter(fset), 0); + return *this; + } + + public: + template + self& add_property(char const* name, Get fget) + { + base::add_property(name, this->make_getter(fget), 0); + return *this; + } + + template + self& add_property(char const* name, Get fget, DocStrOrSet docstr_or_set) + { + this->add_property_impl(name, this->make_getter(fget), docstr_or_set, 0); + return *this; + } + + template + self& + add_property(char const* name, Get fget, Set fset, char const* docstr) { base::add_property( name, this->make_getter(fget), this->make_setter(fset), docstr);