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

Ralf W. Grosse-Kunstleve rwgk at yahoo.com
Mon Aug 25 17:43:39 CEST 2003


--- David Abrahams <dave at boost-consulting.com> wrote:
> Just wrap it once and everything should work.  No importing needed.

But there is something to watch out for. Say you have a module A and another
module B. Let A have a class_<X> statement. Let B have a .def statement for a
function with the signature

    foo(const X&);

Before you call this function foo() from Python, module A has to be imported
from somewhere. Otherwise the converters for X will not be available.

The reason is that Boost.Python V2 (unlike V1) has a global converter registry.
Each module registers its converters in the global registry when it is imported
the first time. From that point on the converters are available in any other
Boost.Python extension module.

Ralf


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com




More information about the Cplusplus-sig mailing list