Re: Objective-C++ and overloading and inheritance of static member functions
Re: Objective-C++ and overloading and inheritance of static member functions
- Subject: Re: Objective-C++ and overloading and inheritance of static member functions
- From: Jiri Volejnik <email@hidden>
- Date: Tue, 26 Apr 2005 12:52:52 +0200
Hmm, strange...
I have no trouble to compile and run the code below with Xcode 1.5.
-- Jirka
In Bjarne's example, B is derived from A.
Uh, yeah. It is in mine, too. Throw in a ": public A" after the
"class B" and repeat the question. :)
--
Andrew White
// main.mm
#import <iostream>
#import <Foundation/Foundation.h>
class A {
public:
static void f(const char* s) { std::cout << s << std::endl; }
static void f(int n) { std::cout << n << std::endl; }
};
class B : public A {
public:
using A::f;
static void f(NSString* s) { f([s UTF8String]); }
static void applyF(NSString* s) { f(s); }
};
int main (int, char* const[])
{
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
NSString* s = @"Hi";
B::f(s);
B::applyF(s);
[pool release];
}
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden