Does anyone know if it's possible to overload the [] operator and update two values with the input.
Example given:
I have the following function in my class now:
void add(T1 input1, T2 input2)
{
// both variables are std::map
normal_map[input1] = input2;
reversed_map[input2] = input1;
}
But I would like to have it that the [] operator updates both values, example:
class["input1"] = input2; // should do the same as the above add function
Any help will be greatly appreciated