So, I am working on a conversion from an OO language with garbage collection capabilities in C ++. To get started, I want to wrap all objects in shared pointers in order to solve the problem of clipping memory. Right now I'm trying to wrap a vector in a generic pointer and initialize the vector directly. See Question below. Why is this not working and, if possible, how can I make it work?
vector<int> vec({ 6, 4, 9 });
shared_ptr<vector<int>> vec = make_shared<vector<int>>({ 6, 4, 9 });
Sorry to not include the error, the error I get is marked on (make_shared) and printed as:
no instance of function template "std::make_shared" matches the argument list
argument types are: ({...})
Thanks for any answers!
source
share