class template arg is a class template arg is a...
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.
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;
};
With g++ 4.1.2 I get the following compiler errors:
Code:
vec.h: error: expected `)' before ‘begin’
I've tried using typedefs like:
Code:
typedef std::vector<T> Container;
typedef Container::iterator Iterator; // or typedef std::vector<T>::iterator Iterator;
with no luck (nor did I expect it.)
Any help please?
Thank you