diff --git a/content/posts/2022-06-07-multiple-dispatch-in-c++/index.md b/content/posts/2022-06-07-multiple-dispatch-in-c++/index.md index 902149a..b2377bf 100644 --- a/content/posts/2022-06-07-multiple-dispatch-in-c++/index.md +++ b/content/posts/2022-06-07-multiple-dispatch-in-c++/index.md @@ -107,11 +107,11 @@ and can be used for testing, etc... ## Double dispatch through the Visitor pattern -Sometimes single dispatch is not enough, such as in the collision example at -the beginning of this article. In cases where a computation depends on the -dynamic type of *two* of its values, we can make use of double-dispatch by -calling a virtual method on the first value, which will call a virtual method -on the second value. +Sometimes single dispatch is not enough, such as in the collision example at the +beginning of this article. In cases where a computation depends on the dynamic +type of *two* of its values, we can make use of double-dispatch by leveraging +the Visitor design pattern. This is done by calling a virtual method on the +first value, which itself will call a virtual method on the second value. Here's a commentated example: