Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

std::vector is supposed to work in the common cases, so you don't need to manually realloc for small/medium sized vectors. If you need to handle a lot of data, avoiding realloc is still an issue and you should pre-compute the length and use vector::resize (or the length-aware constructor).


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: