• 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: curly braces to return value
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: curly braces to return value


  • Subject: Re: curly braces to return value
  • From: Jens Alfke <email@hidden>
  • Date: Tue, 06 Aug 2013 20:41:35 -0700

I don’t use that feature directly in most code I write, but it can be SUPER USEFUL when defining tricky macros, because it lets you create something that evaluates to an express but can have temporary variables and arbitrary logic inside of it.

Another fun-with-curly-braces GCC extension I do use a lot is inline struct literals:
	[foo setOffset: (NSPoint){3.0, 4.0}];
Yeah, I know there’s NSMakePoint et al, but this works with any struct type and is IMHO clearer to read.

—Jens
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


References: 
 >curly braces to return value (From: Matt Neuburg <email@hidden>)

  • Prev by Date: Re: curly braces to return value
  • Next by Date: Two internal clang compiler errors
  • Previous by thread: Re: curly braces to return value
  • Next by thread: Two internal clang compiler errors
  • Index(es):
    • Date
    • Thread