vector<T>::iterator return type
Hi,
I'm trying to write some code that involves creating a function to return a vector iterator. I'm not sure what is wrong. Code:
template <typename T> class VectorTemplate Code:
VectorTemplate.h:140: error: type ?std::vector<T, std::allocator<_CharT> >? is not derived from type ?VectorTemplate<T>? |
What is declaration of m_theVector?
|
First of all, you need typename before vector<T>::iterator. The error occurs before the function body is even looked at, so this might be your only problem.
Kevin Barry |
savotije - it is a vector.
ta0kira - I thought that it just needs to be in the class to use the typename T already stated. Code:
template <typename T> class VectorTemplate |
ta0kira - thanks, I should have taken that more literally.
Fixed: typename vector<T>::iterator getBegin() |
All times are GMT -5. The time now is 12:33 PM. |