It is better to use an std::unique_ptr here in case an exception goes off during the insert.