Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[sonar] Use "std::make_unique" to construct "std::unique_ptr".
[simgrid.git] / src / bindings / python / simgrid_python.cpp
index f900c97..c92a795 100644 (file)
@@ -153,7 +153,7 @@ PYBIND11_MODULE(simgrid, m)
       .def(py::init([](std::vector<std::string> args) {
         static char noarg[] = {'\0'};
         int argc            = static_cast<int>(args.size());
-        std::unique_ptr<char* []> argv(new char*[argc + 1]);
+        auto argv           = std::make_unique<char*[]>(argc + 1);
         for (int i = 0; i != argc; ++i)
           argv[i] = args[i].empty() ? noarg : &args[i].front();
         argv[argc] = nullptr;