Re: Help Mixing Objective-C & Objective-C++
Re: Help Mixing Objective-C & Objective-C++
- Subject: Re: Help Mixing Objective-C & Objective-C++
- From: Sean McBride <email@hidden>
- Date: Wed, 23 Feb 2011 15:05:07 -0500
- Organization: Rogue Research Inc.
On Wed, 23 Feb 2011 13:41:41 -0600, Ken Thomases said:
>> 2) You can keep C++ out of your Obj-C .h files like so:
>>
>> #ifdef __cplusplus
>> typedef SomeCPPClassPtr SomeCPPClassRef;
>> #else
>> typedef void* SomeCPPClassRef;
>> #endif
>
>It might be better to follow the pImpl (pointer-to-implementation) pattern.
That's a good idea. It occurs to me that another option, if you can
require clang and 10.6, is to not have any ivars in your .h at all, and
put them in the .mm instead. That keeps your .h C++-free. See: -fobjc-
nonfragile-abi2 and:
<http://www.mcubedsw.com/blog/index.php/site/comments/new_objective-
c_features/>
--
____________________________________________________________
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