Update memory.h

Updated the templates to contain the full definition of unique_ptrs