Re: how to pass arguments by reference
Re: how to pass arguments by reference
- Subject: Re: how to pass arguments by reference
- From: glenn andreas <email@hidden>
- Date: Thu, 11 Dec 2008 08:51:04 -0600
On Dec 10, 2008, at 10:11 AM, Mark Woollard wrote:
You can't use passing by reference in C or Objective-C, you can with
C++ or Objective-C 2.0, for example the following will compile:
// Method using reference
- (int)func:(int&)a;
Note that references aren't fully supported by the lower level runtime
(though this may have improved). This includes using @encode on a
structure that has field that is a reference, and introspection of
method parameters. The latter mean that NSInvocation can't be used
with methods that use references (and since the undo mechanism is
based around NSInvocation, you can't use methods with invocations with
the undo manager).
There are/were similar problems with AltiVec/SSE vectors as well (and
other issues with templates).
Glenn Andreas email@hidden
<http://www.gandreas.com/> wicked fun!
JSXObjC | the easy way to unite JavaScript and Objective C
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden