37 #include <boost/python.hpp> 60 def(
"func2", (
int(*)(
int,
int))0, f_func2());
67 class_<AClass>(
"AClass",
"a class")
69 .def(init<
int, optional<double> >())
71 .def(
"AMethod", (
int(
AClass::*)(
int,
double))0,
72 f_AMethod(args(
"i",
"d"),
"amethod"))
74 .def(
"BMethod",
f2_BMethod, args(
"i",
"d"),
"bmethod2")
76 f_CMethod((arg(
"i"), arg(
"d1")=1., arg(
"d2")=2.),
77 "cmethod: return i*d1*d2")
double CMethod(int i, double d1=1., double d2=2.)
BOOST_PYTHON_FUNCTION_OVERLOADS(f_func2, func2, 1, 2)
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_AMethod, AMethod, 0, 2)
BOOST_PYTHON_MODULE(test05)
double(AClass::* f2_BMethod)(double)
int(AClass::* f1_BMethod)()