File: deprecated-std-bind2nd.patch

package info (click to toggle)
dolfin 2019.2.0~legacy20240219.1c52e83-21
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 32,012 kB
  • sloc: xml: 104,040; cpp: 102,227; python: 24,356; sh: 460; makefile: 330; javascript: 226
file content (34 lines) | stat: -rw-r--r-- 1,315 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
diff --git a/dolfin/io/HDF5File.cpp b/dolfin/io/HDF5File.cpp
index fa14042cf..c696f5b74 100644
--- a/dolfin/io/HDF5File.cpp
+++ b/dolfin/io/HDF5File.cpp
@@ -21,6 +21,7 @@

 #include <cstdio>
 #include <fstream>
+#include <functional>
 #include <iomanip>
 #include <iostream>
 #include <string>
@@ -916,7 +917,7 @@ void HDF5File::write(const Function& u, const std::string name)
   std::transform(x_cell_dofs.begin(),
                  x_cell_dofs.end(),
                  x_cell_dofs.begin(),
-                 std::bind2nd(std::plus<std::size_t>(), offset));
+                 std::bind(std::plus<std::size_t>(), std::placeholders::_1, offset));

   const bool mpi_io = _mpi_comm.size() > 1 ? true : false;

diff --git a/dolfin/io/XDMFFile.cpp b/dolfin/io/XDMFFile.cpp
index fd5b0a202..314c9644a 100644
--- a/dolfin/io/XDMFFile.cpp
+++ b/dolfin/io/XDMFFile.cpp
@@ -1265,7 +1265,7 @@ void XDMFFile::add_function(MPI_Comm mpi_comm, pugi::xml_node& xml_node,
   std::transform(x_cell_dofs.begin(),
                  x_cell_dofs.end(),
                  x_cell_dofs.begin(),
-                 std::bind2nd(std::plus<std::size_t>(), offset));
+                 std::bind(std::plus<std::size_t>(), std::placeholders::_1, offset));

   const std::int64_t num_cell_dofs_global
     = MPI::sum(mpi_comm, cell_dofs.size());