[C++-sig] [tutorial] Auto-Overloading example bug?

Roman Yakovenko roman.yakovenko at gmail.com
Tue Sep 12 07:03:00 CEST 2006


On 9/12/06, David Abrahams <dave at boost-consulting.com> wrote:
> Joel de Guzman <djowel at gmail.com> writes:
>
> > Roman Yakovenko wrote:
> >> On 8/31/06, Joel de Guzman <djowel at gmail.com> wrote:
> >>> Ok, disregard that. I did check it out and the error is the def it
> >>> should be:
> >>>
> >>>      .def("foo", (void(*)(bool, int, char))0, foo_overloads());
> >>>
> >>> I fixed the docs and updated to CVS.
> >>
> >> Do you want to consider to fix "def"?
> >>
> >> .def("foo", foo_overloads() );
> >>
> >> It is not clear why user should pass second argument.
> >
> > I don't think it can be fixed. The compiler does not have enough
> > information in there to know the exact signature needed. I may
> > be wrong though, so I'll investigate. If you know how to implement
> > this, I'm all ears.
>
> I don't think you're wrong.

Actually my idea was simple: foo_overloads class derives from
boost::python::detail::overloads_base class. I think you can use this
fact and to remove
the need to pass function signature to the "def".


-- 
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/



More information about the Cplusplus-sig mailing list