Greetings, everyone, and don't laugh at me for being a poor novice programmer
I'm trying to implement a (very specific) Database class, and I think it'd be nice to be able use some of the generic algorithms on it, like find. So here's my code (stripped to the barest minimum which won't compile):
The compiler says things like 'std::vector<_Ty>::iterator' : dependent name is not a type prefix with 'typename' to indicate a type. Obviously, it has a grudge against me for something.Code:#include <vector> using namespace std; template<class Type> class Database { private: vector<Type> _data; public: vector<Type>::iterator begin() { return _data.begin(); } vector<Type>::iterator end() { return _data.end(); } };
Or does anyone think otherwise?