• 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: how to pass arguments by reference
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >how to pass arguments by reference (From: Nick Rogers <email@hidden>)
 >Re: how to pass arguments by reference (From: Dave DeLong <email@hidden>)
 >Re: how to pass arguments by reference (From: Dave DeLong <email@hidden>)
 >Re: how to pass arguments by reference (From: Mark Woollard <email@hidden>)

  • Prev by Date: Re: Countdown With NSTimer - Hours, Minutes, Seconds Remaining?
  • Next by Date: Re: Wow - what happened to IB
  • Previous by thread: Re: how to pass arguments by reference
  • Next by thread: RE: how to pass arguments by reference
  • Index(es):
    • Date
    • Thread