The goal of this exercise is to appreciate the importance of manipulating data structures that are contiguous in memory.
- Starting from
containers.cpp, fill astd::array, astd::vectorand astd::listwith 1’000’000’000 numbers, measuring the time it takes for each - For
std::vectortry with and without callingreserve() - For
std::vectorandstd::listtry with a container already constructed with the right size - For
std::arraythe operation can fail badly. Why?