[C++-sig] BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS default args core dump

Wichert Akkerman wichert at wiggy.net
Mon Jun 13 23:21:12 CEST 2011


On 2011-5-9 18:34, Ralf W. Grosse-Kunstleve wrote:
> Hi Holger,
>
> You don't need the BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS macro if you support keyword arguments (which is usually best). It should be as simple as:
>
> .def("foo",&DefaultArgs::foo, (bp::arg("arg1")=100, bp::arg("arg2")=10))

Nice, I had not discovered that anywhere in the documentation. Is there 
a similar construction that works for constructors as well?

Wichert.

-- 
Wichert Akkerman <wichert at wiggy.net>   It is simple to make things.
http://www.wiggy.net/                  It is hard to make things simple.


More information about the Cplusplus-sig mailing list