Re:The Performance Impact of C++'s `final` Keyword
by wzdd on Tuesday April 23, 2024 @07:12AM
(#40130520)
And it's better style because it better conveys intent. An if-else chain in C/C++ implies there's something important about the ordering of cases. Though I'd say that for a very small number of cases it's fine.
(Also, Python has a switch-like construct now.)