Search code examples
c++objective-cobjective-c++

What Are Some Quirks/Surprises with Using .mm Files in Objective-C?


I want to use some C++ STL collections in my Objective-C iPhone app. Apparently this is possible by giving files the extension ".mm" . What are some of the quirks/surprises associated with this?

I want to use the basic containers that I'm familiar with (vector, queue, set, ...)

Cheers!


Solution

  • See Using C++ With Objective-C for a detailed list of what you can and can't do. You can do most things that you would expect. You just can't do things like have a C++ class inherit from an Objective-C class or vice-versa, you can't mix C++ exceptions with Objective-C exceptions, and C++ introduces several new keywords not present in Objective-C.