Skip to content

Commit 94063f7

Browse files
committed
Keyword argument support tweak
[SVN r15544]
1 parent a0ff708 commit 94063f7

2 files changed

Lines changed: 3 additions & 15 deletions

File tree

include/boost/python/init.hpp

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,8 @@ class init : public init_base<init<BOOST_PYTHON_OVERLOAD_ARGS> >
217217
}
218218

219219
template <class Keywords>
220-
init(Keywords const& kw)
221-
: base(0, kw.range())
220+
init(Keywords const& kw, char const* doc_ = 0)
221+
: base(doc_, kw.range())
222222
{
223223
typedef typename detail::error::more_keywords_than_init_arguments<
224224
Keywords::size, n_arguments
@@ -294,18 +294,6 @@ class init<> : public init_base<init<> >
294294
{
295295
}
296296

297-
template <class Keywords>
298-
init(char const* doc_, Keywords const& kw)
299-
: base(doc_, std::make_pair(kw.base(), kw.base() + Keywords::size))
300-
{
301-
}
302-
303-
template <class Keywords>
304-
init(Keywords const& kw)
305-
: base(0, std::make_pair(kw.base(), kw.base() + Keywords::size))
306-
{
307-
}
308-
309297
template <class CallPoliciesT>
310298
init_with_call_policies<CallPoliciesT, self_t>
311299
operator[](CallPoliciesT const& policies) const

test/args.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ BOOST_PYTHON_MODULE_INIT(args_ext)
5454
def("f2", f, f_overloads(args("x", "y", "z")));
5555
def("f3", f, f_overloads(args("x", "y", "z"), "f3's docstring"));
5656

57-
class_<Y>("Y", init<int>())
57+
class_<Y>("Y", init<int>(args("value"), "Y's docstring"))
5858
.def("value", &Y::value)
5959
;
6060

0 commit comments

Comments
 (0)