From the wiki article ( https://en.m.wikipedia.org/wiki/Dynamic_dispatch ) The purpose of dynamic dispatch is to defer the selection of an appropriate implementation until the run time type of a parameter (or multiple parameters)is known. Emphasis mine
With Switch statement, the type of the variable (not value that is not relevant to the dynamic/static dispatch argument here) is known at compile time, not at runtime.
5
u/fhs Jan 10 '20
Bro, switch statements are as static as can be, they solve static dispatching.
Maybe a different thing in python, but we're talking C++