0

While doing a project for my CS class, I ran into a bit of a problem while trying to inherit from the vector class. From everything I looked at, my syntax was correct, but it keeps throwing the error "syntax error: missing ',' before '<'" and no matter what I tweak in it, it doesn't seem to solve anything. Any help would be greatly appreciated.

This is my "gVector.h" file.

#pragma once
#include <vector>

template <typename T>
class gVector : public vector<T> {
public:
gVector(int low, int high);

T& operator[](int i);

void resize(int lowIndex, int highIndex);

private:
    int lower;
    int upper;
};
#include "gVector.cpp"
kawnet587
  • 1
  • 1
  • If that's the sum total of your code, you need `std::vector`. – Ken Y-N Nov 02 '16 at 06:32
  • I had tried that before after reading through that post and it didn't work, but now it seems to have solved the problem. May be because of a few things I tweaked throughout my troubleshooting. Thank you for the help! – kawnet587 Nov 02 '16 at 06:42

0 Answers0