-
Template Problem
Hi,
The following code gives an error:
Code:
#include<vector>
template <class range_type, class T>
class range_vector
{
public:
typedef std::vector<T>::iterator iterator;
protected:
std::vector<T> v;
range_type range_start;
};
The problem seems to be with the typedef. Why is this not allowed?
Thanks!
-
Re: Template Problem
Could you please also post the error that you are getting? It usually helps to know what the exact error is...
-
Re: Template Problem
typedef typename std::vector<T>::iterator iterator;
-
Re: Template Problem
Thanks Yves, that solved it!