• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Mixing C++ and Objective-C
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mixing C++ and Objective-C


  • Subject: Re: Mixing C++ and Objective-C
  • From: "Sean McBride" <email@hidden>
  • Date: Mon, 9 Feb 2009 16:11:43 -0500
  • Organization: Rogue Research Inc.

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@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:

This email sent to email@hidden

References: 
 >Mixing C++ and Objective-C (From: Steve Wart <email@hidden>)
 >Re: Mixing C++ and Objective-C (From: Peter N Lewis <email@hidden>)

  • Prev by Date: RE: Question regarding nullified relationship objects
  • Next by Date: -[PDFView drawPage:] and Printing
  • Previous by thread: Re: Mixing C++ and Objective-C
  • Next by thread: Re: Mixing C++ and Objective-C
  • Index(es):
    • Date
    • Thread