Tag Dispatching Idiom

Learn about the tag dispatching idiom.

We'll cover the following

Now that we have discussed traits, we will move our discussion to tag dispatching.

Tag dispatching allows the selection of a function based on the type properties:

  • The selection takes place at compile time.
  • Traits are used as selection criteria.

Let’s start with the tag dispatching code and implement a fine-tailored advance_ algorithm optimized for the used container.

Note: The std::advance algorithm is already part of the Standard Template Library.

Get hands-on with 1200+ tech skills courses.