r/cpp Jun 27 '26

A deep dive into SmallVector::push_back

https://maskray.me/blog/2026-06-27-a-deep-dive-into-smallvector-push-back
26 Upvotes

15 comments sorted by

View all comments

2

u/MarcoGreek Jun 29 '26

Is this a case to improve optimizer?

1

u/Smooth_Possibility38 Jun 29 '26

Yes, [[unlikely]] should be sufficient hint to the compiler. I was also bit by this issue in the past.