2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-30 20:12:37 +00:00

Fixed init<...> bug where there are no default arguments. Added a test case for this.

[SVN r15224]
This commit is contained in:
Joel de Guzman
2002-09-09 02:36:54 +00:00
parent ee1cc99c65
commit f8490a8850
3 changed files with 11 additions and 3 deletions

View File

@@ -262,7 +262,7 @@ namespace detail {
struct count_optionals2 {
BOOST_STATIC_CONSTANT(
int, value = boost::mpl::size<typename T::sequence>::value);
int, value = boost::mpl::size<typename T::sequence>::value + 1);
};
template <class T>
@@ -407,9 +407,8 @@ template <class ClassT, class CallPoliciesT, class InitT>
void
define_init(ClassT& cl, InitT const& i, CallPoliciesT const& policies, char const* doc)
{
enum { n_defaults_plus_1 = InitT::n_defaults + 1 };
typedef typename InitT::sequence args_t;
detail::define_class_init_helper<n_defaults_plus_1>::apply(cl, policies, args_t(), doc);
detail::define_class_init_helper<InitT::n_defaults>::apply(cl, policies, args_t(), doc);
}
}} // namespace boost::python