- C++17 STL Cookbook
- Jacek Galowicz
- 59字
- 2025-04-04 19:00:07
Implementing a word frequency counter with std::map
The std::map is very useful when categorizing something in order to collect statistics about that data. By attaching modifiable payload objects to every key which represents an object category, it is pretty simple to implement a histogram of word frequencies for example. This is what we will do in this section.