Skip to content

HW #2 Extra Credit

CT 301: C++ Fundamentals · Summer 2026
HW #2 Extra Credit
Optional, up to 20 points: put your ct::Vector into the Homework 1 program.

Optional extra credit, worth up to 20 points. It is a separate Canvas submission from Homework 2.

The idea

In Homework 1 you built an inventory program on top of std::vector. In Homework 2 you built your own ct::Vector. This extra credit checks that your ct::Vector is good enough to replace std::vector in the Homework 1 program and have everything still work.

What you submit

Just one file: ctvector.h (your Homework 2 vector). Upload it to the "HW #2 Extra Credit" assignment (as a file, or a zip containing it). Nothing else is graded.

How it works

We rebuild the Homework 1 solution using your ct::Vector instead of std::vector, run the Homework 1 tests, check for memory leaks, and run the Homework 2 vector checks on your vector.

Note: Homework 1 stores move-only objects (std::vector<std::unique_ptr<Item>>), so your vector must support move-only element types (a vector that can only copy will not compile here).

How it is scored (20 points)

Start at 20, then:

So the possible scores are 20 / 15 / 10 / 5 / 0. You get 0 if it does not build, a test fails, there is a hard memory error (double free, use-after-free), or your ctvector.h uses std::vector or a smart pointer.

Deadline

See the due date on the Canvas assignment for your section. Optional, no late submissions.