error: there are no arguments to 'at' that depend on a template parameter, so a declaration of at must be available
Noob here, I'm trying to compile this segment of code from Bjarne Stroustrup's 'The C++ Programming Language' but CodeBlocks keeps throwing me this error. The code is about range checking an array held in a vector function. Here is the code: #include <iostream> #include <vector> #include <array> using namespace std; int i = 1000; template<class T> class Vec : public vector<T> { public: Vec() : vector<T>() { } T& operator[] (int i) {return at(i); } const T& operator[] (int i) const {return at(i); } //The at() operation is a vector subscript operation //that throws an exception of type out_of