When to Use Enums and When to Use Tag Dispatching in C++--Jonathan Boccara

What is your preference?

When to Use Enums and When to Use Tag Dispatching in C++

by Jonathan Boccara

From the article:

Enums and tag dispatching are two ways to introduce several behaviours in the same interface in C++. With them, we can pass arguments that determine a facet of how we want a function to behave.

Even if enums and tag dispatching have that in common, they achieve it in a quite different way. Realizing what these differences are will give you tools to decide which one to use in any given situation...

Add a Comment

Comments are closed.

Comments (0)

There are currently no comments on this entry.