Click to See Complete Forum and Search --> : Template Problem


cancel
March 26th, 2008, 06:39 AM
Hi,

The following code gives an error:



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

Edders
March 26th, 2008, 06:52 AM
Could you please also post the error that you are getting? It usually helps to know what the exact error is...

Yves M
March 26th, 2008, 07:06 AM
typedef typename std::vector<T>::iterator iterator;

cancel
March 26th, 2008, 07:21 AM
Thanks Yves, that solved it!