Grading: 70% correctness, 30% style
Due Oct 31 at 9PM
There are two parts to this homework.
In the last homework, you wrote
edit specialized to
edit from homework 5 as a function template in
The template argument should abstract over the argument type, so
edit should now have the declaration
template <typename T> void edit(T &).
Write your own
unique_pointer class template, a simplified version of
Implement the member functions declared in
You can implement them in the header file or write your own implementation file and
#include it in the header.
The class member functions should behave the same way as the standard
unique_ptr (see the reference)
If you need to throw an exception, throwing anything (like an
string) is fine.
unique_pointer.hpp, and implementation file(s) if you chose to separate the interface and implementation of your templates.
main1.cpp files we will
#include "edit.hpp", and in
main2.cpp we will
The code should compile without errors or warnings with the options
g++ -Wall -std=c++17 -g main1.cpp (and for
Your executables should never leak memory (test using