Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
More uses of std::make_unique.
[simgrid.git] / src / smpi / colls / smpi_openmpi_selector.cpp
index e5f5e92..ffbcae7 100644 (file)
@@ -8,6 +8,8 @@
 
 #include "colls_private.hpp"
 
+#include <memory>
+
 namespace simgrid {
 namespace smpi {
 
@@ -565,7 +567,7 @@ int scatter__ompi(const void *sbuf, int scount,
         (block_size < small_block_size)) {
       std::unique_ptr<unsigned char[]> tmp_buf;
       if (rank != root) {
-        tmp_buf.reset(new unsigned char[rcount * rdtype->get_extent()]);
+        tmp_buf = std::make_unique<unsigned char[]>(rcount * rdtype->get_extent());
         sbuf   = tmp_buf.get();
         scount = rcount;
         sdtype = rdtype;