I want to write a C++ object that behaves almost equivalent to a Python dictionary. C++'s `std::map` and `std::unordered_map` accommodate some of the functionalities that Python dictionaries already have, yet lack one of the most important capabilities, namely, being able to add arbitrary objects and types. Even if it isn't possible, how close can you get to achieving the capabilities of Python's dictionary?

A few previous questions ([here](https://stackoverflow.com/questions/27674009/c-equivalent-of-python-dictionaries) and [here](https://stackoverflow.com/questions/1842941/translating-python-dictionary-to-c)) fail to handle the issue of adding multiple types to the dictionary.

For example, I want to be able to do something like this in C++:

```py
my_dict = {'first': 1,
           'second': "string",
           'third': 3.5,
           'fourth': my_object}
my_dict['fifth'] = list([1, 2, 3])

```

The best solutions that I can think would be like using `void` pointers to data which get reinterpreted, or perhaps some kind of run-time polymorphism with some type restrictions?