templates of templates...

Started by
2 comments, last by Dwiel 21 years, 3 months ago
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]
Advertisement
Please use source tags when posting template code. As you no doubt notice, it doesn''t look very good without them.
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  
Sorry bout the tags... and thanx for the help Miserable!

I knew that there must be a better way!

Tazzel3d ~ dwiel

This topic is closed to new replies.

Advertisement