std::vector + namespace + template problem

Started by
2 comments, last by __fold 20 years, 6 months ago
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]
Advertisement
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 
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]
el
Thanks! I would never had figured that one out myself.

This topic is closed to new replies.

Advertisement