Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Default template arguments under Jag

Default template arguments under Jag
Thread Tools
Mac Elite
Join Date: Sep 2000
Location: Tempe, AZ
Status: Offline
Reply With Quote
Aug 19, 2002, 07:07 PM
 
Is anyone else having problems using default template arguments under Jaguar and gcc 3?

The following code that compiled just fine under the last dev tools release (April, I think), now breaks:
Code:
#include <vector> template <class T, class Allocator = allocator <T> > class MyClass { };
The error that I'm getting is
Code:
parse error before `<' token
on the 'template' line. Removing the default template argument fixes things.
Geekspiff - generating spiffdiddlee software since before you began paying attention.
     
smeger  (op)
Mac Elite
Join Date: Sep 2000
Location: Tempe, AZ
Status: Offline
Reply With Quote
Aug 19, 2002, 09:24 PM
 
Just in case anyone else has this problem, it looks like gcc 2.9.5 automatically scoped std::, but 3.1 doesn't. Adding std:: to the STL stuff fixed it. I also needed to use the 'typename' keyword in a few new places.

The biggie was that I was getting link errors on everything in the STL until I created a new project and moved all of the source files into it. I'd tried tossing the 'build' folder, cleaning targets, and rebuilding the index, but that didn't work. Creating a new project did.
Geekspiff - generating spiffdiddlee software since before you began paying attention.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 06:11 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2