Re: overloading operators
Re: overloading operators
- Subject: Re: overloading operators
- From: Wade Tregaskis <email@hidden>
- Date: Thu, 31 Oct 2002 18:05:31 +1100
Am I right in thinking that you can't overload operators in your
custom classes in objective-C? If I'm wrong, could someone give me a
short code example?
You're right. Operator overloading isn't something you can do in
Objective-C, because operators aren't implemented as message sends.
That's the functional problem. The ideological one is that operators
shouldn't be over-extended to places where they really don't belong, as
can sometimes happen with over-zealous C++ coders. ObjC has no fears
of being verbose, so - for instance - the choice of using a clearly
named method "append" vs the operator += is considered a no brainer.
Wade Tregaskis
_______________________________________________
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.