> On Jun 10, 2015, at 8:48 AM, Uli Kusterer <[email protected]> 
> wrote:
> 
> Sounds like a job for a macro:

Yeah, later on I changed to:

#if __has_feature(objc_generics)
#define CBLArrayOf(VALUE) NSArray<VALUE>
#define CBLDictOf(KEY, VALUE) NSDictionary<KEY, VALUE>
#else
#define CBLArrayOf(VALUE) NSArray
#define CBLDictOf(KEY, VALUE) NSDictionary
#endif

which to me feels easier to read, e.g. “CBLArrayOf(NSString*)”.

Maybe I’ll file a Radar to add this to the Foundation headers, so everyone can 
use NSArrayOf() and NSDictionaryOf() instead of re-inventing the wheel.

—Jens
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Objc-language mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/objc-language/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to