Exercise: Tag Dispatching

Test your understanding of the tag dispatching idiom.

We'll cover the following

Problem statement

Read the following code and extend it using the advance_ function provided. Write code in the main function to do the following:

  1. Advance an iterator of a std::vector by a positive distance

  2. Advance an iterator of a std::list by a positive distance and then by a negative distance

  3. Advance an iterator of a std::forward_list by a positive distance

Coding exercise

Get hands-on with 1400+ tech skills courses.