A good interface is one where your guess as to what things do is what they actually do. A large part of that is function naming too. Unfortunately the [] convenience function for a map doesn't have a descriptive name, and many people that guess its behaviour, get it wrong.
That said, it is terribly convenient, and many of us would be lost without it.



LinkBack URL
About LinkBacks




perator[] is perfectly intuitive for people who learned C arrays. Migrating C programmers have always been an important target for the designers of C++ and its standard library.
CornedBee