[C++-sig] passing raw pointers of interface impls

Ben Scott bscott at iastate.edu
Fri Jan 10 05:30:43 CET 2003


>>
>>Yeah, I had tried that, but since Creator is an
>>abstract type it can't be instantiated as you are
>>suggesting. 
> 
> 
> You have to remove the no_init from the class_<CreatorWrap>
> declaration.
> 
> 
>>This of course causes the "RuntimeError:
>>This class cannot be instantiated from Python" error
>>from the default __init__ in Creator that BPL defines.
> 
> 
> One of these days, we'll have the __init__ function generated by
> no_init check the actual Python class being created to make sure it's
> not the base type (Creator, in this case).  Until then, just leave out
> no_init and you'll be fine.
> 

Well that's reasonable. I guess I was trying to keep it so that python 
users could not instantiate the Creator in order to mirror the C++ side. 
It sounds that your proposed change to BPL would certainly eliminate the 
issue I was seeing. Either way, the removal of no_init will solve my 
near-term problems.

Thanks for you quick replies and help!

cheers,
-----
Ben Scott
Research Assistant
VR Juggler Team
Virtual Reality Applications Center
bscott at vrac.iastate.edu






More information about the Cplusplus-sig mailing list