2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-24 18:12:43 +00:00

Keyword argument support tweak

[SVN r15544]
This commit is contained in:
Dave Abrahams
2002-09-29 03:25:04 +00:00
parent a0ff708d29
commit 94063f7862
2 changed files with 3 additions and 15 deletions

View File

@@ -217,8 +217,8 @@ class init : public init_base<init<BOOST_PYTHON_OVERLOAD_ARGS> >
}
template <class Keywords>
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<init<> >
{
}
template <class Keywords>
init(char const* doc_, Keywords const& kw)
: base(doc_, std::make_pair(kw.base(), kw.base() + Keywords::size))
{
}
template <class Keywords>
init(Keywords const& kw)
: base(0, std::make_pair(kw.base(), kw.base() + Keywords::size))
{
}
template <class CallPoliciesT>
init_with_call_policies<CallPoliciesT, self_t>
operator[](CallPoliciesT const& policies) const

View File

@@ -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>("Y", init<int>())
class_<Y>("Y", init<int>(args("value"), "Y's docstring"))
.def("value", &Y::value)
;