When i overload the operator [] for a vector is there any better way of using it inside the class definition itself ie.
Class Dataset
......
int& operator[](int x){
return vector[x];
}
bool compare(int position, int variable){
return operator[](position)==variable // is there any...
This is pretty basic but how do you use insert() for vectors, i want to place an int x ant position i. i.e. insert(i,x), but it won't compile stating that no such defn for insert exists.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.