How well is Objective-C++ supported?

Disclaimer: I don't work or speak for Apple, so this is my opinion:

I can't speak for the major dev shops, but in my small group, we've used Objective-C++ both for integrating C++ libraries, and as you propose for writing backends in C++. As @alxp mentions, things like exception handling across the language boundary are painful, but with a little planning, most of these pains can be avoided. For experienced C++ devs, the gains can be well worth the pain.

In terms of support, I think you can assume that support in its current state won't go away any time soon. It's part of the GCC code base and the Clang toolchain (Apple's next compiler toolchain) fully supports Objective-C++. On the other hand, there isn't any official guarantee that Apple will continue to develop the integration—fixing some of the warts, for example.

For current projects, I would say that if using Objective-C++ provides benefit, it is safe to rely on the existing support and you should use it.


The only times I've used ObjC++ was to port libraries to make them accessible from my ObjC code. The clashes between how ObjC++ and ObjC handle things like exceptions and class creation and destruction just made it too much of a headache to juggle the two languages in one project.

I don't think support will go away soon as happened with Cocoa / Java since it is pretty solidly part of GCC, and the fact that Objective-C++ compiles down to straight C++ in the same way that Objective-C can compile down to straight C, but I still don't find it a very pleasant environment to build software in compared with Objective-C and being able to comfortably fully use the OS X-provided frameworks.


Objective-C++ is likely to remain supported as long as Objective-C is. Obj-C++ is a basic goal for clang, which is expected to eventually replace gcc as Apple’s preferred compiler. Usage is likely to rise as Carbon applications are moved to Cocoa front ends.

Of course, the word “likely” appears twice above because Apple is so excitingly unpredictable. :-)


I suspect Apple will continue to support Objective C++ for a while, as I don't see any significant recurring effort required by Apple to maintain Objective C++ as Apple updates Cocoa and Objective C++.