The Standard Library has an extensive collection of generic functions in the <algorithm> header file. By generic we mean that they access data via iterators without knowing what the iterators refer to and so it means that you can write generic code to work for any appropriate container. However, if you know the container type and that container has a member method to perform the same action, you should use the member.
Algorithms
Iteration of items
Many of the routines in <algorithm> will take ranges and iterate over those ranges performing some action. As the name suggests, the fill function will fill a container with a value. The function takes two iterators to specify the range and a value that will be placed...