3 ms·
I've always understood Objective C++ to be a way to mix in C++ source code in an Objective-C code base, not really a new language but more of a "mode" of linkin
by filleokus 3y ago
I've always understood Objective C++ to be a way to mix in C++ source code in an Objective-C code base, not really a new language but more of a "mode" of linking / compiling.
> Objective-C++ does not add C++ features to Objective-C classes, nor does it add Objective-C features to C++ classes. For example, you cannot use Objective-C syntax to call a C++ object, you cannot add constructors or destructors to an Objective-C object, and you cannot use the keywords this and self interchangeably. The class hierarchies are separate; a C++ class cannot inherit from an Objective-C class, and an Objective-C class cannot inherit from a C++ class. In addition, multi-language exception handling is not supported
From a Stack Overflow comment / archived Apple docs:
https://stackoverflow.com/a/3684159 https://stackoverflow.com/a/3684159
https://web.archive.org/web/20101203170217/http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/ObjectiveC/Articles/ocCPlusPlus.html https://web.archive.org/web/20101203170217/http://developer....
- jwells89 3y agoYes, in my experience the most common usages are to pair an Objective-C Cocoa UI to cross platform C++ internals, to use C++ for more performance critical parts of an app, or even to just be able to take advantage of the plethora of C++ libraries without going all-in on C++. Things might’ve changed with Swift being around now, but as I understand one place where the Obj-C UI + C++ internals setup used to be common was Audio Unit extensions due to the high latency sensitivity of anything working with audio.
- TillE 3y agoThat first one is probably the most common, you'll see .mm files for Apple-specific platform code in many big cross-platform C++ projects.