Re: ObjectiveC AND C++ Templates.
Re: ObjectiveC AND C++ Templates.
- Subject: Re: ObjectiveC AND C++ Templates.
- From: Sherm Pendley <email@hidden>
- Date: Thu, 29 May 2003 09:41:45 -0400
On Thursday, May 29, 2003, at 08:11 AM, Poornima Ranganath wrote:
Is there a way to use "C++ templates" like <list> ,<vector>, <map> etc.
in ObjectiveC - Cocoa?
Yes, and no...
There's Objective-C++, which lets you mingle C++ code with Objective-C.
However, even though both kinds of code can appear in the same file,
they're not completely interchangeable. You can't, for example, call C++
methods using Objective-C's messaging syntax, nor can you use C++
templates with Objective-C classes.
Some of the things you *can* do is create C++ objects and assign them to
Objective-C instance variables, and vice versa. You can send Objective-C
messages inside C++ methods, and vice versa.
In other words, Objective-C++ lets the two languages exist side-by-side,
and talk to one another to an extent, but it doesn't really merge them
into a single language. It can be quite useful if you have, for example,
a set of model classes written in C++ - you can continue to use those
classes directly, while writing your interface in Cocoa with Objective-C.
sherm--
The wise programmer is told about Tao and follows it. The average
programmer is told about Tao and searches for it. The foolish programmer
is told about Tao and laughs at it.
If it were not for laughter, there would be no Tao.
-- The Tao of Programming
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.