> Consider an *instance* of a std::map< std::string, std::string >, for > example. You CAN "just add things on the fly" to it, can't you? Isn't > it handy, indeed sometimes crucial, to be able to add any foo->bar > mapping entry to the class on the fly, as and if and when the need > arises, at runtime, rather than having to pre-declare all the set > of 'keys' that are going to be allowed and/or mandatory for all > instances of such a type...? I am not sure you understand the point I am trying to make here. Even if I were to make a map with void* where the type of the object being stored becomes irrelevant, it still would not be what I am talking about. The only way to add anything to your mapInstance is to add strings like: mapInstance["Python"]="Is cool, please don't shoot me." I can't simply expand the object by adding new variables that have nothing to do with the laid-out definition of the map. Once I instantiate the map, I can't simply type "mapInstance.newVariable=5".
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4