Hottest Free Downloads - DownloadPipe.com Over 197,000 downloads! Bookmark Now!
DownloadPipe.com - New Downloads Every Minute
 SEARCH:
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Template Syntax Error in Xcode: parse error before `>' token

 
   Mac (Home) -> Programmer Help RSS
Next:  Build a "export" bundle document  
Author Message
steve

External


Since: Dec 06, 2005
Posts: 13



(Msg. 1) Posted: Thu Jan 19, 2006 9:58 am
Post subject: Template Syntax Error in Xcode: parse error before `>' token
Archived from groups: comp>sys>mac>programmer>help (more info?)

I'm porting some code over from Codewarrior and have run into a problem
with method templates. I have a class with a template method, which
passes the typename to another template method of another class object.
So in the code below, the mBuffer object has a template method Create
which is a template defined in the same way as this method. But Xcode
gives me a compile error:

template <typename T>
bool Setup() {
if(!mBuffer) {
if(!mBuffer.Create<T>()) { // error: parse error before `>' token
return false;
}
}
return true;
}

This same code compiles fine in Codewarrior and I can't figure out what
I'm missing. It just seems not to like 'Create<T>'. I have tried
'Create<typename T>' but that doesn't work either.

Does anyone know the magic trick to getting Xcode to like this?

Thanks in advance,

Steven Walker
Back to top
Login to vote
steve

External


Since: Dec 06, 2005
Posts: 13



(Msg. 2) Posted: Thu Jan 19, 2006 10:04 am
Post subject: Re: Template Syntax Error in Xcode: parse error before `>' token [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

I found the answer. For some reason Xcode needs to be told explicitly
that the method is a template:
mBuffer.template Create<T>
Back to top
Login to vote
Display posts from previous:   
Related Topics:
error: parse error before "}" token (newbie needs help) - Hello First post on this board with a question relating to my first venture into xcode, I have a little bit of programming experience on the windows side, im new to macs as well so please go easy on me.. I have system 10.3.9 and am using xcode version....

GMP and xCode error - The GMP (bignumber) build without any error but when it try to link with the libgmp.a in xCode I got a lot of error: Building target ³syracuse² ‹ (1 error) mkdir..

What causes the 'can't map file' error? - I'm porting open source for Linux to Mac OS X. I think I generated every .a or .lib but the final link gives an error message. /usr/bin/ld: can't map file: /Users/smcho/Desktop/OpenAccess/lib/mac_osx_32/opt ((os/kern) invalid argument) What might be..

No return statement does NOT result in a compile error!!! - Hello, I have 1 question. If I create a XCode default C++ Command Line application and change the default main.cpp (remove the return statement) to: int main(int argc,char** arg) { } I do NOT get a compile time error on the missing return statement.....

error: macro "isspace" passed 2 arguments, but takes just 1 - I have just installed Mac OS 1.0.4.3 and got problems compiling with XCode 2.1: /usr/include/gcc/darwin/4.0/c++/bits/localefwd.h:58:34: error: macro "isspace" passed 2 arguments, but takes just 1 The compiler confuses the function template&...
       Mac (Home) -> Programmer Help All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum
Categories:
 Windows Forums
 Game Forums
 Linux Forums
  Mac Forums
 PDA Forums
 Mobile Forums
  Top  |  Store  |  RSS Feeds RSS  |  Data Feeds  |  Advertise  |  Submit  |  Bookmark  |  Newsletter  |  Contact