 <p>All you have to do is correct your signatures like so:</p> <pre><code>const T&amp; operator [](char* b) const; T&amp; operator [](char* b); </code></pre> <p>I've removed the <code>const</code> qualifier from the second operator.</p> <blockquote> <p>if I use <code>AssArray["llama"]=T</code>, how am I supposed to get the value of T into the operator overloading-function?</p> </blockquote> <p>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 <code>"llama"</code> does not exist in the array, you need to create an entry for it, and return a reference to that entry.</p>