All you have to do is correct your signatures like so:
const T& operator [](char* b) const;
T& operator [](char* b);
I've removed the const
qualifier from the second operator.
if I use
AssArray["llama"]=T
, how am I supposed to get the value of T into the operator overloading-function?
You don't. You just return a reference to where the new value should be stored, and the compiler will take care of the rest. If "llama"
does not exist in the array, you need to create an entry for it, and return a reference to that entry.