Re: OK to Use C++ Shorthand Constructs in a Cocoa Project?
Re: OK to Use C++ Shorthand Constructs in a Cocoa Project?
- Subject: Re: OK to Use C++ Shorthand Constructs in a Cocoa Project?
- From: Óscar Morales Vivó <email@hidden>
- Date: Fri, 4 Nov 2005 09:29:31 -0500
On Nov 4, 2005, at 09:23 , glenn andreas wrote:
On Nov 3, 2005, at 11:05 PM, John Stiles wrote:
Cameron Hayne wrote:
On 3-Nov-05, at 9:50 PM, Jerry Krinock wrote:
I was wondering if someone could
explain to me why C++ is not enabled in a new Cocoa project
created by the
Assistant in Xcode?
Most people using Cocoa program in Objective-C, which is a
superset of C, not of C++.
But you can use C++ if you want - you get Objective-C++ if you
name your files with ".mm" suffixes.
You should read Apple's docs about mixing C++ and Objective-C.
I don't think there are really official numbers on what "most"
people do :)
Personally, I highly recommend Objective-C++. Even if you aren't a
big C++ fan, it gives you the freedom to to use basic C++ language
constructs like declaring variables in places other than the top
of the function, like "for( int x=0; x<10; x++ )". Or simplified
syntax for things like "struct Foo {}" versus "typedef struct Foo_
{} Foo;" or whatever the C equivalent was.
I thought most of those things were already in the C-99 standard. Not
sure it's enabled by default, though, but just look for the flag in
the project settings.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden