Fwd: Interfacing with C++

deadalnix via Digitalmars-d digitalmars-d at puremagic.com
Mon Nov 3 12:57:20 PST 2014


On Monday, 3 November 2014 at 18:24:12 UTC, Shriramana Sharma via 
Digitalmars-d wrote:
> 1) How mature is the SWIG support for wrapping a library into D?
> Specifically does the above SWIG support take advantage of the
> built-in C++ support features like connecting directly to 
> virtual
> functions?
>

I investigated this recently. It actually work fairly well, minus 
2 things:
  - swig use 0 terminated sting to pass string back en forth. But 
in C++, char* can be a string or a buffer, and when it is the 
later, you can run into problems.
  - swig generate unnecessary garbage in the binding layer.

I tried to work on it, but swig require serious ramp up to 
contribute to.



More information about the Digitalmars-d mailing list