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

Ralf Grosse-Kunstleve rwgrosse-kunstleve at lbl.gov
Mon Jun 13 23:59:51 CEST 2011


Hi Wichert,

Yes, it also works for constructors. For example:

http://cci.lbl.gov/cctbx_sources/scitbx/r3_utils_ext.cpp

Ralf

On Mon, Jun 13, 2011 at 2:21 PM, Wichert Akkerman <wichert at wiggy.net> wrote:

> 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.
>
> _______________________________________________
> Cplusplus-sig mailing list
> Cplusplus-sig at python.org
> http://mail.python.org/mailman/listinfo/cplusplus-sig
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20110613/76592f7d/attachment.html>


More information about the Cplusplus-sig mailing list