Re: Xcode 5 & Obj-C++
Re: Xcode 5 & Obj-C++
- Subject: Re: Xcode 5 & Obj-C++
- From: Scott Ribe <email@hidden>
- Date: Thu, 30 Jan 2014 15:09:31 -0700
Google Taligent. (Snicker, snicker, snicker...) They actually wrote a good book on the subject, which was very effective at convincing most sane people to JUST NOT EVEN TRY THAT ;-)
Anyway, this has *nothing* to do with Cocoa, OS X, iOS or Xcode. It's just C++, and such things are covered to varying extents in many many C++ books.
On Jan 30, 2014, at 2:35 PM, Rui Pacheco <email@hidden> wrote:
> Is this documented somewhere?
>
> On 30 Jan 2014, at 22:26, Jens Alfke <email@hidden> wrote:
>
>>
>> On Jan 30, 2014, at 4:32 AM, Jean-Daniel Dupas <email@hidden> wrote:
>>
>>> It is barely possible to create a stable ABI in C++. This language suffers all possible form of fragile base class problem:
>>> Add a new ivar, all subclasses and stack allocated objects are broken.
>>> Add a new virtual method, you break all virtual subclasses.
>>
>> Exactly. Also, the use of templates or inline methods in library classes will cause library code to get built into the calling app at compile time. After that, the library has to be very careful not to break compatibility with such code to avoid breaking the app. A typical obvious example is changing the implementation of an inline method; newly compiled apps will get the new behavior but existing apps will keep the old behavior since the inlined code is in the app not the library. That's bad news if the old inline method accesses private state of the old version of the class that no longer exists in the same form in the new version.
>>
>> It is possible to create binary-compatible C++ APIs but you have to be very, very careful — generally there are a lot of rules about the use of inlines and templates; you have to add placeholder data members and virtual methods to classes to reserve room for future expansion, etc.
>>
>> —Jens
>> _______________________________________________
>>
>> 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
>
> _______________________________________________
>
> 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
--
Scott Ribe
email@hidden
http://www.elevated-dev.com/
(303) 722-0567 voice
_______________________________________________
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