Re: Question on Objective C++
Re: Question on Objective C++
- Subject: Re: Question on Objective C++
- From: Chris Thomas <email@hidden>
- Date: Wed, 06 Mar 2002 11:51:52 -0800
On 3/6/02 10:36 AM, "Lance Bland" <email@hidden> wrote:
>
last time I checked ...
>
>
On Wednesday, March 6, 2002, at 12:46 PM, Oscar Morales Vivs wrote:
>
>
> The docs state that the only C++ object instances that you can put in
>
> an Objective-C object are those that don't have virtual functions.
>
>
I find that hard to believe. The docs must be wrong. It probably means
>
you can only place pointers and new them on the freestore. You probably
>
can't have value or reference definitions.
I'm pretty sure the docs are correct on this point. You can define a C++
class as an inline value, as long as the class has no vtable. The following
is perfectly legal:
class Funky {int a;};
@interface Groovy
{
Funky my_funk;
}
@end
The release note explains:
>
C++ requires each instance of a class containing virtual functions to contain
>
a suitable virtual function table pointer. However, the Objective-C runtime
>
cannot initialize the virtual function table pointer, because it is not
>
familiar with the C++ object model.
Chris
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.