posts: multiple-dispatch: add visit downside

This commit is contained in:
Bruno BELANYI 2022-11-02 16:06:51 +01:00
parent bb48eaea34
commit 7c6db4c19e

View file

@ -254,3 +254,7 @@ int main() {
// Calls CollideDispatch::operator()(Spaceship&, Asteroid&) // 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.