C++ Overload the subscript operator to call a function based on the type assigned : I have an object that has functions like "addString" and "addInteger". 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?

    jsonBuilder builder();
    
    builder[ "string_value" ] = "Hello";
    builder[ "int_value" ] = 5;
    builder[ "another_string" ] = "Thank you";