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.

Leave a Comment