Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Foo new] vs [[Foo alloc] init]:



On Feb 15, 2008, at 1:20 PM, email@hidden wrote:
Well, 'new' is a reserved word in C++, so if you use Cocoa's 'new'
method you'll never be able to use Objective-C++ with that code.  It's
kind of like how using 'id' as a variable name in C++ is a bad idea.

Actually, that's not true. You can use C++ keywords as method names in Objective-C++; I've done it (specifically +class) without problems. Method names just aren't treated quite the same as other identifiers. The only thing is the syntax colorer highlights them as keywords.


--
David Catmull
email@hidden
http://www.uncommonplace.com/

_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.