Mixing C++ and Obj-C (odd compile errors)
Mixing C++ and Obj-C (odd compile errors)
- Subject: Mixing C++ and Obj-C (odd compile errors)
- From: Brad Peterson <email@hidden>
- Date: Sun, 16 Sep 2007 03:52:24 -0700 (PDT)
Hi all,
I'm trying to include some C++ code in my
Cocoa/Foundation tool, and I'm getting a lot of
strange errors when compiling.
Specifically, a section like this:
template<class T>
WORD get_next_id(const std::map<WORD, T>& map_cont)
{
std::map<WORD, T>::const_iterator it =
map_cont.begin();
is generating quite a few errors.
(WORD is typedef'd as: typedef UInt16 WORD;)
The errors are:
1. error: expected `;' before 'it'
2. error: dependent-name
'std::map<cab_header::WORD,T,std::less<cab_header::WORD>,std::allocator<std::pair<const
cab_header::WORD, T> > >::const_iterator' is parsed as
a non-type, but instantiation yields a type
3. note: say 'typename
std::map<cab_header::WORD,T,std::less<cab_header::WORD>,std::allocator<std::pair<const
cab_header::WORD, T> > >::const_iterator' if a type is
meant
It's been a really long time since I had to deal with
pure C++ and I confess these errors are far beyond my
ability to understand, let alone solve.
I'm hoping someone here has had to do something very
similar recently, and can offer me some insight. :)
Any thoughts or suggestions would be greatly
appreciated.
Many thanks,
B
____________________________________________________________________________________
Got a little couch potato?
Check out fun summer activities for kids.
http://search.yahoo.com/search?fr=oni_on_mail&p=summer+activities+for+kids&cs=bz
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden