Re: Bilingual shenanigans
Re: Bilingual shenanigans
- Subject: Re: Bilingual shenanigans
- From: email@hidden
- Date: Fri, 13 Sep 2002 17:34:46 -0400
I just tried it with 10.2/August Dev Tools.
The Objective-C++ compiler does allow a C++ object as an instance
variable of an Objective C object, but warns that any user-defined
constructor won't be called:
Compiling main.mm (3 warnings)
In file included from main.mm:10:
Parent.h:21: warning: type `Member' has a user-defined constructor
Parent.h:21: warning: type `Member' has a user-defined destructor
Parent.h:21: warning: C++ constructors and destructors will not be
invoked for Objective-C fields
#import <Foundation/Foundation.h>
#include <iostream>
class Member{
public:
Member() { std::cout << "Member() called." << std::endl; }
~Member() { std::cout << "~Member() called." << std::endl; }
};
@interface Parent : NSObject {
Member mMember;
}
- (id)init;
- (void)dealloc;
@end
--Squeegee
On Friday, September 13, 2002, at 05:01 PM, Finlay Dobbie wrote:
>
On Friday, September 13, 2002, at 09:00 pm, Ondra Cada wrote:
>
>
>> I don't know... Does Objective-C++ allow Objective-C classes to
>
>> have instance
>
>> variables that are C++ instances, as opposed to pointers to C++
>
>> instances?
>
>
>
> I think so (but their constructors won't get called automatically).
>
>
I'm pretty sure it doesn't, actually.
>
>
-- Finlay
>
_______________________________________________
>
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.
_______________________________________________
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.