I'm writing a generic Vector class (vector as in linear algebra not STL std::vector). I want to use STL std::vector as the internal container.
With g++ 4.1.2 I get the following compiler errors:Code:#include <vector> template < class T > // specifies what types the std::vector will store class MyClass { public: MyClass(std::vector<T>::iterator begin, std::vector<T>::iterator end) { // blah } //... private: std::vector<T> m_data; };
I've tried using typedefs like:Code:vec.h: error: expected `)' before ‘begin’
with no luck (nor did I expect it.)Code:typedef std::vector<T> Container; typedef Container::iterator Iterator; // or typedef std::vector<T>::iterator Iterator;
Any help please?
Thank you



LinkBack URL
About LinkBacks


