DMD now does Dwarf style exception handling!

Ola Fosheim Grøstad via Digitalmars-d digitalmars-d at puremagic.com
Tue Jan 5 10:45:14 PST 2016


An example from 
http://www.sitepoint.com/using-legacy-c-apis-swift/:

Calling the C function "void takesAnObject(void *theObject);" 
from Swift:

var test = 42
withUnsafePointer(&test, { (ptr: UnsafePointer<Int>) -> Void in
     var voidPtr: UnsafePointer<Void> = unsafeBitCast(ptr, 
UnsafePointer<Void>.self)
     takesAnObject(voidPtr)
})


Maybe it can be done better, but I think it is rather obvious 
that if interfacing looks like that, one doesn't loose much from 
implementing the app using Objective-C++ and Swift without 
bridging much between C++ and Swift.



More information about the Digitalmars-d mailing list