Skip navigation.
 
mlRe: [Foo new] vs [[Foo alloc] init]:
FROM : David Catmull
DATE : Fri Feb 15 22:47:02 2008

On Feb 15, 2008, at 1:20 PM, <email_removed> 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_removed>
http://www.uncommonplace.com/

Related mailsAuthorDate
No related mails found.