Re: Objective C++, C++, and templates
Re: Objective C++, C++, and templates
- Subject: Re: Objective C++, C++, and templates
- From: Jim Crafton <email@hidden>
- Date: Fri, 4 Jul 2003 13:32:41 -0400
On Friday, July 4, 2003, at 01:05 PM, Jim Crafton wrote:
Hi all,
I have some C++ template code that I have residing in a number of
headers
I have an Objective C++ file that includes these headers and if I
compile the source file with the .mm (as Objective C++) I get a heap
of bizarre errors, I think related to not understanding the template
code. If I save the source file as .cpp (C++ Source file) and build
all is well. Is there some issue in pulling in headers with templated
code with Objective C++ ? I have not run into this before and I have
other code in my framework that uses C++ templates and Objective C++
and compiles fine.
I am using Project Builder with GCC 3.1 (*not* using the Dec 2002
updates).
Ackkk
I found the problem
template <class Foo>
class A {
};
this will cause a problem with Objective C++
change it to
template <typename Foo>
class A {
};
and everything is hunky dory!
Sorry to bother folks!
Cheers
Jim
_______________________________________________
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.