Jump to content
  • Advertisement

Archived

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

__fold

std::vector + namespace + template problem

This topic is 5396 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

Is it possible to use templates in a std::vector? I have this piece of code.
//...

#include <vector>
#include <Vector3.h>

//...


private:
   std::vector<Mathlib::Vector3<float>> controlPoints; // Doesn't work

public:
    void addPoint(Mathlib::Vector3<float> vector); // Works  

Edit: I have to allocate it somehow? [edited by - __fold on October 8, 2003 5:48:54 AM]

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
Your solution should work, except that you need to put a space between the right angle brackets, to discern it from the right bitwise shift operator. Like this:
std::vector<Mathlib::Vector3<float> > controlPoints; // Does work 

Share this post


Link to post
Share on other sites
You have to put spaces between two >. So this should work:

std::vector<Mathlib::Vector3<float> > controlPoints;



[edited by - EL on October 8, 2003 5:58:08 AM]

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!