[C++-sig] Re: Boost & cross module definitions

David Abrahams dave at boost-consulting.com
Mon Aug 25 14:54:46 CEST 2003


"Arnaud PICARD" <arnaud.picard at edfgdf.fr> writes:

> Hi,
>
> I'm using boost.python to wrap C++ classes. All I've done as of now is
> efficient, yet I do have one question.
>
> I've had to define, for a number of various modules, the same identical
> class, let's call it data. The problem is, when I want to use methods in
> python that use the wrapped C++ data class from these differents modules,
> it won't work ; basically they are not considered the same class. 

That's because you defined the class multiple times.

> Before I switched from v1.26 to v1.30, the class was wrapped in its
> own module and then I used import_converters<data>(...) for
> cross-module definitions.  However I cannot do so any more. Does any
> one has an idea ?

Just wrap it once and everything should work.  No importing needed.


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





More information about the Cplusplus-sig mailing list