[C++-sig] Overloading & keyword args bug?
amohr at pixar.com
Thu Jun 8 19:45:31 CEST 2006
Ralf W. Grosse-Kunstleve wrote:
> --- Alex Mohr <amohr at pixar.com> wrote:
>>> I am surprised any of your tests works.
>>> AFAIK you need to make several changes:
>>> BOOST_PYTHON_FUNCTION_OVERLOADS(f1_overloads, f1, 1, 3)
>>> BOOST_PYTHON_FUNCTION_OVERLOADS(f2_overloads, f2, 2, 4)
>>> you have to give your C++ functions default arguments.
>> Why is this? Suppose I don't want the functions to have default args in
>> C++ -- only in python.
> I'd simply write a thin C++ wrapper which supplies the default arguments.
Clearly that's potentially a way to work around this, but it seems
silly. Another workaround is to swap the order of the defs.
But really, if it works with only one of the overloads, why shouldn't it
work with both? This really seems like a bug to me.
More information about the Cplusplus-sig