/*
 * Copyright ©2026 Soham Pardeshi. All rights reserved.
 * Permission is hereby granted to students registered for University of
 * Washington CSE 333 for use solely during Summer Quarter 2026 for
 * purposes of the course. No other use, copying, distribution, or
 * modification is permitted without prior written consent. Copyrights
 * for third-party components of this work must be honored. Instructors
 * interested in reusing these course materials should contact the author.
 */

#include <vector>

#include "Tracer.h"

// STL containers store elements BY VALUE: the container keeps its own copy
// of every element (slides 52-54).  Run this and watch "copy ctor" print
// on each push_back.  reserve(3) avoids reallocation; remove it and a
// growing vector copies the existing elements into a bigger buffer too.
int main(int argc, char** argv) {
  std::vector<Tracer> v;
  v.reserve(3);    // no reallocation while we push 3 elements

  Tracer t;        // ctor
  v.push_back(t);  // copy ctor: t is COPIED into the vector
  v.push_back(t);  // copy ctor
  v.push_back(t);  // copy ctor
  // Destructors run here as t and the vector's elements go out of scope.

  return EXIT_SUCCESS;
}