Re: curly braces to return value
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