Stop reimplementing the virtual table and start using double dispatch

AndyG wants us to stop misusing dynamic_cast and start using a visitor pattern

Stop reimplementing the virtual table and start using double dispatch

by AndyG

From the article:

In this tutorial, I’ll talk about one solution to this problem I’ve had some success with: the double-dispatch Visitor pattern. With it, you can trim down those long if-else if blocks, separate responsibility into manageable pieces, and even stabilize your interface better.

Add a Comment

You must sign in or register to add a comment.

Comments (0)

There are currently no comments on this entry.