Meeting 08: Memory Management

Today we will review memory allocation in C++ and go over the basic tool for managing memory, the pattern Resource Acquisition is Initialization or RAII, and introduce Copy Constructors and the Assignment Operator.

In-class Exercise: DynamicBag

Lets define and implement a dynamically-sized Bag ADT

  1. Download the starter code
  2. In dynamic_bag.hpp define the class DynamicBag conforming to the BagADT interface.
  3. Extend dynamic_bag_tests.cpp to implement tests for the methods using Catch.
  4. In dynamic_bag.tpp implement the DynamicBag methods.
  5. Build your code locally as you work.
  6. Submit your dynamic_bag.hpp, dynamic_bag.tpp, and dynamic_bag_tests.cpp files collected into a zip file via Canvas at the Assignment "Exercise for Meeting 8". You can create this zip file using the CMake submission target.