On 2008-12-11, Jason Roelofs <jameskilton / gmail.com> wrote:

> Because of the  complexity that C++ adds, I  doubt that any feasible
> FFI library can be made that works reliably against C++ libraries,

I was afraid of that.

> Rice - ...
> Rb++ - ...

I looked at  those but I thought they were  targeted at generating MRI
bindings.  The point of using FFI is to eliminate MRI-specific C code.
I just need to wrap C++ with C to get functions that FFI can call, eg.

    extern "C" {

    void *thing_new() { return new Thing(); }
    void thing_delete(void *vt) { delete (Thing *) vt; }
    void *thing_bar(void *vt) { return ((Thing *) vt)->bar(); }

    // etc. etc. etc.
    }

I already know this works, now I'm trying to save effort, particularly
with parsing C++  and autogenerating wrapper code.  Maybe  I could use
rbgccxml and  add my  own XML  -> wrapper code  backend.  It  looks as
though rbgccxml is  precisely the bit of rbplusplus  that I would want
to reuse.

Thanks for your help,

Jeremy Henty