I am trying to overload [] operator like this.
char* myclass::operat or[](char* str)
{
....
}
Basically I should be able to handle these cases
char* c1=myclass["test"];
char* c2="test2";
myclass["test']=c2;
So, myclass["test"] can appear either in rhs or lhs of an expression. In my operator[] function which has to handle these cases differently, how will I differentiate it?
char* myclass::operat or[](char* str)
{
....
}
Basically I should be able to handle these cases
char* c1=myclass["test"];
char* c2="test2";
myclass["test']=c2;
So, myclass["test"] can appear either in rhs or lhs of an expression. In my operator[] function which has to handle these cases differently, how will I differentiate it?
Comment