| 32 | } |
| 33 | |
| 34 | constexpr int FastestCar() |
| 35 | { |
| 36 | int max = -1; |
| 37 | int maxId = -1; |
| 38 | for(int i = 0; i < 3; ++i) { |
| 39 | const auto* car = CreateCar(i); |
| 40 | |
| 41 | if(car->speed() > max) { |
| 42 | max = car->speed(); |
| 43 | maxId = i; |
| 44 | } |
| 45 | |
| 46 | delete car; |
| 47 | } |
| 48 | |
| 49 | return maxId; |
| 50 | } |
| 51 | |
| 52 | int main() |
| 53 | { |