Dark Secrets of std::map [ ] operator
While trying to read the value corresponding to key, If we accidentally pass a key which doesn't exist in the map using [ ] operator, , then the element is silently inserted into map. Let us see this in action, Initialize a simple harmless map with 3...
Feb 9, 20221 min read30
![Dark Secrets of std::map [ ] operator](https://cdn.hashnode.com/res/hashnode/image/unsplash/Q1p7bh3SHj8/upload/v1644389565181/TOGZT4bGp.jpeg)