Re: Function overloading for ObjC classes
Re: Function overloading for ObjC classes
- Subject: Re: Function overloading for ObjC classes
- From: Phillip Hutchings <email@hidden>
- Date: Sun, 22 Feb 2004 23:05:01 +1300
On 22/02/2004, at 7:23 PM, Allan Odgaard wrote:
>
I wanted to write two versions of a function, one for NSData and
>
another for NSMutableData. Unfortunately the compiler says that I
>
redefine the same function. Example:
>
[snip]
From what it looks like, you're overloading two C functions. Check the
extension is .mm, not .m and it should work. Or declare it as id and
check the type in the function.
>
I wonder, is this a GCC bug? Overloading does work for "different"
>
classes (i.e. non sub/super class relationships).
I guess if it's a C++ function, then it's a GCC bug. C++ should support
it. If it's an Objective C method, they the fact that you can override
like that is a bug.
--
Phillip Hutchings
email@hidden
http://www.sitharus.com/
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
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.