I have a vector like this:
std::vector<std::unique_ptr<Service> > m_vec;
I can run push_back like this:
m_vec.push_back(std::make_unique<Service>());
But when I run it like this:
std::unique_ptr<Service> pt = std::make_unique<Service>();
m_vec.push_back(pt);
I got error no matching function for call to ‘std::vector<std::unique_ptr<Service> >::push_back(std::unique_ptr<Service>&)
Does &
mean that I'm pushing a reference to the vector? If so, why can't I push a reference?