Maybe it's a really basic question.....
..but why does this NOT work?
Respectively what options do I have to get this working?
g++ reports:
expected constructor, destructor, or type conversion before ...
(I marked the line below in which the error occured.)
Your help is very appreciated!
Thanks!
#ifndef SAMPLE_H_
#define SAMPLE_H_
#include <iterator>
#include <vector>
template <typename T>
class Sample {
private:
typedef std::vector<T> vectorType;
vectorType vector;
public:
typedef typename vectorType::iterator vectorIterator;
vectorIterator begin();
};
#endif
template <typename T>
vectorIterator Sample<T>::begin() { <== ERROR HERE
return vector.begin();
}