Use an object if the indexes are strings, a vector if they are integers and you only have one type, an array if the keys are integers but you need multiple types that doesn't have a common base type and use a dictionary if the keys are anything else. So basically we use those class depending on what kind of indexes and element types that we want to use? And there is no rules that we must use Object class for creating associative array? |
I may update this post with links to useful resources related to each one... then again, I may forget. :P
No comments:
Post a Comment