On 2/9/09 10:42 AM, Peter N Lewis said:

>Personally, I just switch the whole project to compile everything in
>Objective C++ and this eliminates the need for ifdef __cplusplus at
>essentially no cost in compile time, execution speed or executable
>size.  It just means you are only dealing with one version of C to go
>with your Objective C rather than C, C++ and Objective C.

This can be a good idea, of course, but if you do this you loose a few things:

 - Xcode's refactoring does not work with C++/Obj-C++
 - 'genstrings' has problems with C++
 - some compiler warnings don't work with C++ (others are C++ only)
 - the clang static analyser doesn't support C++ (yet)
 - etc.

Although I wonder if some of these limitations are only with .mm files
or even if you only tell Xcode to always build as Obj-C++...

For these reasons, I've found it better to use C++ only when I really need to.

--
____________________________________________________________
Sean McBride, B. Eng                 [email protected]
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to