Status of Win32 C++ interop

Laeeth Isharc via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Sep 8 05:55:59 PDT 2015


On Monday, 7 September 2015 at 18:37:49 UTC, Benjamin Thaut wrote:
> On Friday, 4 September 2015 at 16:19:49 UTC, Laeeth Isharc 
> wrote:
>> Hi Benjamin
>>
>> Would you be able to give a little more colour on what the 
>> limits are of interoperability for C++ with DMD master or 
>> release ?  As I understand it destructors and constructors 
>> don't work, and obviously it will get tricky passing 
>> structures and classes from C++ libraries not ported to D.
>
>
> So, things that work really well are classes...
> So far I haven't found a situation where I couldn't make it 
> work the way I wanted.  Its just some work to write the D 
> headers for the C++ classes and vise versa, because you have to 
> duplicate everything once more. An automated tool for this 
> would be nice, but unfotunately there is currently none.


This is really very clear and helpful, and I appreciate your 
taking the time.  I will place it on the wiki if that's okay.

Library support is surely one of the largest impediments to the 
adoption of D, and we ought to place some emphasis on updating 
the documentation here:
http://dlang.org/cpp_interface.html

How does it work when external APIs expect objects from the C++ 
standard library?  strings, and so on?  How about funny pointer 
types?  shared_ptr  etc?  std::vector, std::list?

Here is one C++ library used by many in finance (at least as a 
backup).  I think there might be a decent amount of value in 
making this usable from D.  (Trying to put my own interests 
aside!)  Paging Andy Smith ?

http://quantlib.org/reference/_bermudan_swaption_8cpp-example.html

Are there any well-known C++ libraries that you have interfaced 
to ?  Could you give some examples of how long it takes ?

Would you be able to drop me an email about something else?  No 
contact info on your blog, but my domain is 
kaleidicassociates.com and my user id is laeeth@


Laeeth.


More information about the Digitalmars-d-learn mailing list