Finish C++ memory class implementation