4 ms·
If the routine is truly going to consume the widget, then you’re paying for a copy within the routine if you take the parameter by reference. Unfortunately that
by MontagFTB 6y ago
If the routine is truly going to consume the widget, then you’re paying for a copy within the routine if you take the parameter by reference. Unfortunately that’s just kicking the can down the road.
I’d prefer code like this use the move operation to make the code reasonably efficient and maintainable. Then, only after its proven the line is on a critical performance path, it can be further optimized later.