• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Objective-C++ and overloading and inheritance of static member functions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Objective-C++ and overloading and inheritance of static member functions (From: Jiri Volejnik <email@hidden>)
 >Re: Objective-C++ and overloading and inheritance of static member functions (From: Andrew White <email@hidden>)

  • Prev by Date: Re: Binding button.enabled to "NSTextField is not empty"
  • Next by Date: Re: Showing submenu item in an NSPopUpButton
  • Previous by thread: Re: Objective-C++ and overloading and inheritance of static member functions
  • Next by thread: NSNetServiceBrowser / NSNetService Hostname Lookup
  • Index(es):
    • Date
    • Thread