On 2010-10-25 19:51:18 -0400, Walter Bright <[email protected]> said:

Jimmy Cao wrote:
I was talking to a guy about D earlier.
He said that C++ has too much momentum, whilst D is just standing still.
I'm sure if D were to gain this platform, it would be able to gain serious momentum.

I'm curious how C++ deals with Cocoa.

Apple has this Objective-C++ thing, where C++ objects cohabit with Objective-C object. It's nothing fancy really as both Objective-C and C++ are extension to C, and there is no overlap in syntax.

        class MyCppObject {
                int i;
        };

        @interface MyObjcObject : NSObject {
                int i;
        }
        @end

        MyCppObject *cpp = new MyCppObject;
        MyObjcObject *objc = [[MyObjcObject alloc] init];

--
Michel Fortin
[email protected]
http://michelf.com/

Reply via email to