From 03c427534d7a28ffd4485324dfb81b08f52fd679 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Wed, 2 Nov 2022 16:06:51 +0100 Subject: [PATCH] posts: multiple-dispatch: add visit downside --- content/posts/2022-11-02-multiple-dispatch-in-c++/index.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/content/posts/2022-11-02-multiple-dispatch-in-c++/index.md b/content/posts/2022-11-02-multiple-dispatch-in-c++/index.md index 3de5865..b20bfa6 100644 --- a/content/posts/2022-11-02-multiple-dispatch-in-c++/index.md +++ b/content/posts/2022-11-02-multiple-dispatch-in-c++/index.md @@ -260,3 +260,7 @@ int main() { // Calls CollideDispatch::operator()(Spaceship&, Asteroid&) } ``` + +Obviously, the issue with adding a new `SpaceStation` variant is once again +apparent in this implementation. You will get a compile error unless you handle +this new `SpaceStation` variant at every point you `visit` the `SpaceObject`s.