3 ms·
In C++ if the class has non-trivial constructors, neither stack nor heap allocations are free. So in C++ reusing objects is still often better for performance.
by netheril96 8y ago
In C++ if the class has non-trivial constructors, neither stack nor heap allocations are free. So in C++ reusing objects is still often better for performance.
- guipsp 8y agoI'd argue that if your constructors/destructors are non-trivial, then reusing objects is also often non-trivial.