Archived

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

__fold

std::vector + namespace + template problem

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
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