[C++-sig] class registration - bug or feature?

David Abrahams dave at boost-consulting.com
Fri Jul 7 07:22:27 CEST 2006


"Roman Yakovenko" <roman.yakovenko at gmail.com> writes:

> Hi. Please take a look on next code
>
> struct X{
>     void do_smth();
> };
>
> class_<X>("X");
>
> class_<X>("X")
>     .def( "do_smth", &X::do_smth );
>
> Boost.Python reports a warning while registering class X second time:
> "to-Python converter for struct X already registered; second
> conversion method ignored."
> But, indeed Boost.Python continues to register the class - I mean,
> that Boost.Python adds functions to the already registered class.

That's not the same as registering it again.

> My question: is this a bug or it is a desired behaviour?

Desired.  Or at least, expected.  There's been nothing better
proposed.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com




More information about the Cplusplus-sig mailing list