Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[sonar] Use "std::make_unique" to construct "std::unique_ptr".
[simgrid.git] / include / xbt / functional.hpp
index e84506f..b2d1043 100644 (file)
@@ -40,7 +40,7 @@ public:
     std::vector<std::string> args = *args_;
     if (not args.empty()) {
       char noarg[] = {'\0'};
-      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;