6 ms·
In C++, you can have clean code and performance, by utilizing templates. In the example given, all polymorphism can be removed, and the shapes can be stored in
by axilmar 4y ago
In C++, you can have clean code and performance, by utilizing templates.
In the example given, all polymorphism can be removed, and the shapes can be stored in std::tuple structure.
And then the operations would be faster than C, since no switch statement would be needed.
- adamrezich 4y agothen your compile times balloon even larger than they already are in C++