Re: Objective-C++
Re: Objective-C++
- Subject: Re: Objective-C++
- From: "Dennis C. De Mars" <email@hidden>
- Date: Wed, 25 Jul 2001 22:24:40 -0700
on 7/25/01 9:22 PM, Ben Jansen at email@hidden wrote:
>
It doesn't sound like there's much knowledge about Cocoa w/ Obj-C++
>
(besides that it's coming), but just in case someone knows:
>
>
Will I be able to use the C++ Standard Library, and, more importantly,
>
the STL? All the STL container classes are invaluable to me.
I'm sure the entire C+++ standard library is supported, it wouldn't be of
much use if it didn't, since most existing C++ code has some dependency on
it.
Of course, when calling Cocoa classes, any container arguments are going to
require the Cocoa container objects (NSArray, NSDictionary, NSString, etc.)
so you will probably end up using the Cocoa container classes to a certain
extent, unless you want to do a lot of unpacking and packing between the STL
containers and the Cocoa containers.
I use the STL classes a lot in my C++ programming and I also find them
invaluable in that context. However, it seems to me that the Cocoa classes
listed above have about the same functionality as vector, map, and string,
and they are designed to interact well with Cocoa objects (for instance,
NSArray does an automatic retain on its elements and a release on each
element when it is released itself). So, I'm not going to go out of my way
to use the STL equivalents, but they are certainly there if you need them.
Speaking of questions about Obj-C++, one thing I am wondering about is the
interaction, if any, of Objective C identifiers with namespaces. Are
Objective C class names qualifiable with C++ namespace qualifiers, or all
they just in a global namespace as usual? How about other Objective C
entities such as selectors?
- Dennis D.
- Dennis D.