Code:
#include <iostream>
#include <vector>
using namespace std;
struct Entry {
string name;
int number;
};
void add_entries(int n, vector<Entry> &vec)
{
vec.resize(vec.size() + n);
}
template<class T> class Vec : public vector<T> {
public:
Vec():vector<T>() { } //call the default vector constructor
Vec(int s):vector<T>(s) { }
T& operator[](int i) { return at(i); }
const T& operator[] (int i) const { return at(i); }
};
It seems like i cant compile this... The error is in the bolded line inside the template class Vec:
`template<class _Tp, class _Alloc> class std::vector' used without template parameters
I dont know why?