#C A factory function to create a car
| 21 | |
| 22 | // #C A factory function to create a car |
| 23 | constexpr Car* CreateCar(int i) |
| 24 | { |
| 25 | switch(i) { |
| 26 | case 0: return new Mercedes{}; |
| 27 | case 1: return new Toyota{}; |
| 28 | case 2: return new Tesla{}; |
| 29 | } |
| 30 | |
| 31 | return nullptr; |
| 32 | } |
| 33 | |
| 34 | constexpr int FastestCar() |
| 35 | { |
no outgoing calls
no test coverage detected