mirror of
https://github.com/boostorg/parameter_python.git
synced 2026-01-28 07:22:28 +00:00
Fixed 0-arity init.
[SVN r34528]
This commit is contained in:
committed by
Peter Dimov
parent
edb5b4547e
commit
1d0e9ed2f4
@@ -22,6 +22,7 @@
|
||||
# include <boost/mpl/next.hpp>
|
||||
# include <boost/mpl/begin_end.hpp>
|
||||
# include <boost/mpl/not.hpp>
|
||||
# include <boost/mpl/empty.hpp>
|
||||
# include <boost/python/def.hpp>
|
||||
# include <boost/python/make_constructor.hpp>
|
||||
# include <boost/python/to_python_converter.hpp>
|
||||
@@ -355,7 +356,7 @@ namespace aux
|
||||
{}
|
||||
|
||||
template <class F>
|
||||
void def(F f, int const*) const
|
||||
void def(F f, not_specified const*) const
|
||||
{
|
||||
cl.def(name, f);
|
||||
}
|
||||
@@ -593,7 +594,13 @@ struct init
|
||||
}
|
||||
|
||||
template <class Class>
|
||||
void visit(Class& cl) const
|
||||
void visit_aux(Class& cl, mpl::true_) const
|
||||
{
|
||||
cl.def(boost::python::init<>()[call_policies]);
|
||||
}
|
||||
|
||||
template <class Class>
|
||||
void visit_aux(Class& cl, mpl::false_) const
|
||||
{
|
||||
typedef typename mpl::transform<
|
||||
ParameterSpecs
|
||||
@@ -617,6 +624,12 @@ struct init
|
||||
);
|
||||
}
|
||||
|
||||
template <class Class>
|
||||
void visit(Class& cl) const
|
||||
{
|
||||
visit_aux(cl, mpl::empty<ParameterSpecs>());
|
||||
}
|
||||
|
||||
CallPolicies call_policies;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user