> > Here's what I mean by not simple. The STL map has no contains() > function, so you have to write a bunch of extra slop, like this: > > if(myMap.find(42) != myMap.end()) > > How much simpler would it be to just write this: > > if(myMap.contains(42)) > > That's what Qt does for you with QMap. They take all the STL > functionality and add a bunch of niceties that make it easy for me to KISS.
Depends on what you mean by simple. By adding a contains method you would introduce additional methods (and complexity) in to the container classes. While a contains class would be convenient at times, it isn't as universally useful as the find method is. I find that I use the find method more than I would ever use contains with find. Also, it allows for greater consistency between the containers and the algorithms. Yes, additional methods might be convenient, but they certainly aren't so inconvenient as to make them essential. I saw a quote the other day, "Syntactic sugar causes cancer of the semicolon."
-------------------- BYU Unix Users Group http://uug.byu.edu/ The opinions expressed in this message are the responsibility of their author. They are not endorsed by BYU, the BYU CS Department or BYU-UUG. ___________________________________________________________________ List Info (unsubscribe here): http://uug.byu.edu/mailman/listinfo/uug-list
