From 94063f786238a3977601802364e4f5feab3ab9cc Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Sun, 29 Sep 2002 03:25:04 +0000 Subject: [PATCH] Keyword argument support tweak [SVN r15544] --- include/boost/python/init.hpp | 16 ++-------------- test/args.cpp | 2 +- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/include/boost/python/init.hpp b/include/boost/python/init.hpp index 1e3f23bb..35f2dc90 100644 --- a/include/boost/python/init.hpp +++ b/include/boost/python/init.hpp @@ -217,8 +217,8 @@ class init : public init_base > } template - init(Keywords const& kw) - : base(0, kw.range()) + init(Keywords const& kw, char const* doc_ = 0) + : base(doc_, kw.range()) { typedef typename detail::error::more_keywords_than_init_arguments< Keywords::size, n_arguments @@ -294,18 +294,6 @@ class init<> : public init_base > { } - template - init(char const* doc_, Keywords const& kw) - : base(doc_, std::make_pair(kw.base(), kw.base() + Keywords::size)) - { - } - - template - init(Keywords const& kw) - : base(0, std::make_pair(kw.base(), kw.base() + Keywords::size)) - { - } - template init_with_call_policies operator[](CallPoliciesT const& policies) const diff --git a/test/args.cpp b/test/args.cpp index 9727b902..ee79fcfa 100644 --- a/test/args.cpp +++ b/test/args.cpp @@ -54,7 +54,7 @@ BOOST_PYTHON_MODULE_INIT(args_ext) def("f2", f, f_overloads(args("x", "y", "z"))); def("f3", f, f_overloads(args("x", "y", "z"), "f3's docstring")); - class_("Y", init()) + class_("Y", init(args("value"), "Y's docstring")) .def("value", &Y::value) ;