I'm building custom operators and im having problems when passing parameters to them.
For example
class test{
public:
test operator[](vector <string> s){
test a;
return a;
}
};
Now if I wanted in my main program to do something like this
int main(){
test d;
vector<string> s;
s.push_back("bla");
d[s];
}
I get a bunch of errors. Is it because I need to have const somewhere or I don't know.
Also I have built in a custom operator for printing out the class test ( << operator ). Now I don't get compile error when calling d[s] in main program but I get compile error when calling cout<< d[s] in main program. The operator << is working because I tested it with simple cout<< d