On 05/05/07, Roman Yakovenko <roman.yakovenko@gmail.com> wrote:
On 5/5/07, Gustavo Carneiro <gjcarneiro@gmail.com> wrote:
>   Is it possible to wrap a C++ class that has pure virtual functions?  I am
> getting a compilation error below; what should I do?
>
> PS: those pure virtual methods are being exclud()ed by me.

If you exclude them, than I guess you don't want Python user to create
instances of the class and derive from it. If I am right, than you
should use no_init:

http://boost.org/libs/python/doc/v2/class.html.

The only way to tweak Py++ to generate no_init for the class is to
exclude all class constructors.

  Well, assuming the code below is correct, it doesn't seem to make any difference:

    for meth in Queue.constructors():
        meth.exclude()

 But, anyway, I just white-listed the pure virtual methods and now it compiles.  They won't work in runtime because they handle unregistered parameters, but that is a lesser evil.

  Thanks anyway,

--
Gustavo J. A. M. Carneiro
"The universe is always one step beyond logic." -- Frank Herbert