I have a class whose copy constructors are explicitly deleted (because A uses pointers internally and I don\'t want to fall into shallow copy pitfalls):
clas
Just want to add to @kayleeFrye_onDeck's answer. I have a near identical situation to theirs, and the exact syntax that works for me (based on the feedback in the comments) is as follows:
vector< std::unique_ptr > names; // Declare vector of unique_ptrs of the class instance
std::unique_ptr name_ptr = std::make_unique();
names.push_back(std::move(name_ptr)); // Need to use std::move()
// Now you can access names objects without error:
names[0]->classMethod();