DEV Community

Discussion on: Fibonacci++

Collapse
 
bosley profile image
Bosley

I also think the "variables" version is more than sufficient, just offering another look.

I've noticed that whenever I've used .reserve(n) with vectors nothing really seems to be gained time-wise. Perhaps I haven't used them in a scenario where it would be of real benefit.

Thread Thread
 
dwd profile image
Dave Cridland

No, I think you're right - in most cases, the allocators these days are simply good enough that the marginal benefit of reserving space isn't useful.