blob: 88da46db04681b7776b20658537a80e56a5a538e [file] [log] [blame]
#import <objc/NSObject.h>
class MyCPPClass {
public:
MyCPPClass(float f) : f(f) {}
float setF(float f) {
float oldf = this->f;
this->f = f;
return oldf;
}
float getF() {
return f;
}
private:
float f;
};
typedef MyCPPClass MyClass;
@interface MyObjCClass : NSObject {
int x;
}
- (id)init;
- (int)read;
@end
@implementation MyObjCClass {
int y;
}
- (id)init {
if (self = [super init]) {
self->x = 12;
self->y = 24;
}
return self;
}
- (int)read {
return self->x + self->y;
}
@end
int main (int argc, const char * argv[])
{
MyClass my_cpp(3.1415);
return 0; // break here
}