Compare commits
6 commits
a7e77c5307
...
30ffd90b2a
| Author | SHA1 | Date | |
|---|---|---|---|
| 30ffd90b2a | |||
| 70f99f21fa | |||
| cb9545769d | |||
| ab2fd4bb69 | |||
| 80ef143ef2 | |||
| 1f65d803a7 |
1 changed files with 0 additions and 10 deletions
|
|
@ -189,16 +189,6 @@ e.g: compilers, where the AST class hierarchy represents the data *only*, and
|
|||
all compiler stages and optimization passes are programmed by a series of
|
||||
visitors.
|
||||
|
||||
One downside of this approach is that if you want to add `SpaceStation` as
|
||||
a sub-class of `SpaceObject`, and handle its collisions with other
|
||||
`SpaceObject`s, you need to:
|
||||
|
||||
* Implement all `collide_with` methods for this new class.
|
||||
* Add a new virtual method `collide_with(SpaceStation&)` and implement it on
|
||||
every sub-class.
|
||||
|
||||
This can be inconvenient if your class hierarchy changes often.
|
||||
|
||||
## Multiple dispatch on a closed class hierarchy
|
||||
|
||||
When even double dispatch is not enough, there is a way to do multiple dispatch
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue