...

/

Use Mapped Lambdas for a Jump Table

Use Mapped Lambdas for a Jump Table

Learn to use mapped lambdas for a jump table.

We'll cover the following...

A jump table is a useful pattern when we want to select an action from a user or other input. Jump tables are often implemented in if/else or switch structures. In this recipe, we’ll build a concise jump table using only an STL map and anonymous lambdas.

How to do it

It’s easy to build a simple jump table from a map and lambdas. The map provides simple indexed navigation ...