• Advertisement

Archived

This topic is now archived and is closed to further replies.

templates of templates...

This topic is 5509 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I was wondering why
  
vector<vector<int>> ppint;
  
doesn't work, but
  
typedef vector<int> vectorint;
vector<vectorint> ppint;
  
does? Is this a problem with the vector class that I coded, or is this how all template classes work? Thanx a lot! "The only thing worse than not having that new _______ , is when some rich kid has it, but can't and/or doesn't appreciate it."-me Tazzel3d ~ Dwiel [edited by - tazzel3d on January 19, 2003 2:50:53 PM]

Share this post


Link to post
Share on other sites
Advertisement
Please use source tags when posting template code. As you no doubt notice, it doesn''t look very good without them.

Share this post


Link to post
Share on other sites
To answer the original question, you just need to insert spaces to resolve some syntax ambiguity:

  
vector<vector<int>> ppint; // won''t work: The closing >> is misinterpreted as operator>>


vector<vector<int> > ppint; // will work

Share this post


Link to post
Share on other sites
Sorry bout the tags... and thanx for the help Miserable!

I knew that there must be a better way!

Tazzel3d ~ dwiel

Share this post


Link to post
Share on other sites

  • Advertisement