[C++-sig] Re: creating an instance of a class_<> object in c++and exporting it to python

David Abrahams dave at boost-consulting.com
Tue Aug 17 22:17:57 CEST 2004


"Mike Rovner" <mike at nospam.com> writes:

> Francois Ostiguy wrote:
>> class_< A, A*, boost:noncopyable>
>>
>> registers a type converter from A* to Python and it is through this
>> converter that the object becomes an instance of the Python type A.
>
> It's (a) create a pytype wrapper class and (b) registers a type
> converter unless you specify boost:noncopyable as you did.

That's about right.

>> Does this mean that only one Python type can/should be declared as
>> holder of a  A* ?  In other words, is it possible to declare two
>> Python types, say A1 and A2, both holding a A* but with different
>> exported interfaces ?
>
> You can't have multiple converters. You'll get a boost compile error trying.

Runtime error/warning, I'm fairly certain.


-- 
Dave Abrahams
Boost Consulting
http://www.boost-consulting.com




More information about the Cplusplus-sig mailing list