Jump to content
  • Advertisement

Archived

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

Dwiel

templates of templates...

This topic is 5726 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
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
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!