Two independent interface mistakes

A C++17 program records three network delays in milliseconds. The required headers are included. Assume the requested capacity is valid and the reservation succeeds.


C++
std::vector delays{1.8, 2.6, 3.9};
auto first = delays.begin();
auto oldCapacity = delays.capacity();
delays.reserve(oldCapacity + 1);
double total = std::accumulate(
    delays.begin(), delays.end(), 0);


Which statements correctly describe the library operations and their consequences? Select all that apply.

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More C++ Standard Library Questions: