Overload the subscript operator to call a function based on the type assigned
<p>I have an object that has functions like <code>addString</code> and <code>addInteger</code>. These functions add data to a JSON string. At the end, the JSON string can be obtained and sent out. How can this be made easier by overloading subscript operators to do the following?</p>

<pre><code>jsonBuilder builder();

builder[ "string_value" ] = "Hello";
builder[ "int_value" ] = 5;
builder[ "another_string" ] = "Thank you";
</code></pre>