]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Remove bind2nd in tests
authorJonathan Robey <class4kayaker@gmail.com>
Thu, 28 Jul 2016 19:36:34 +0000 (12:36 -0700)
committerJonathan Robey <class4kayaker@gmail.com>
Thu, 28 Jul 2016 21:52:25 +0000 (14:52 -0700)
tests/grid/filtered_iterator.cc
tests/grid/filtered_iterator_02.cc
tests/lac/block_vector_iterator.cc
tests/lac/complex_block_vector_iterator.cc
tests/petsc/block_vector_iterator_03.cc
tests/trilinos/block_vector_iterator_03.cc

index 589a64977e9896d49996be5f408056908bb3f1e1..ccb9553c9b8d9e86950f023ca6d2709eeaeca565 100644 (file)
@@ -140,9 +140,9 @@ void test ()
       bool (*predicate) (const active_cell_iterator, const unsigned int)
         = &level_equal_to<active_cell_iterator>;
       FilteredIterator<active_cell_iterator>
-      begin (std::bind2nd (std::ptr_fun(predicate), 3),
+      begin (std_cxx11::bind (std::ptr_fun(predicate), std_cxx11::_1, 3),
              tria.begin_active (3)),
-                               end   (std::bind2nd (std::ptr_fun(predicate), 3),
+                               end   (std_cxx11::bind (std::ptr_fun(predicate), std_cxx11::_1, 3),
                                       tria.end());
 
       Assert (std::distance (begin, end) ==
@@ -164,15 +164,15 @@ void test ()
 
       bool (*predicate) (const active_cell_iterator, const unsigned int)
         = &level_equal_to<active_cell_iterator>;
-      Assert (std::distance (FI(std::bind2nd (std::ptr_fun(predicate), 3))
+      Assert (std::distance (FI(std_cxx11::bind (std::ptr_fun(predicate), std_cxx11::_1, 3))
                              .set_to_next_positive(tria.begin_active()),
-                             FI(std::bind2nd (std::ptr_fun(predicate), 3), tria.end())) ==
+                             FI(std_cxx11::bind (std::ptr_fun(predicate), std_cxx11::_1, 3), tria.end())) ==
               static_cast<signed int>(tria.n_active_cells (3)),
               ExcInternalError());
       logfile << "Check 4: "
-              << (std::distance (FI(std::bind2nd (std::ptr_fun(predicate), 3))
+              << (std::distance (FI(std_cxx11::bind (std::ptr_fun(predicate), std_cxx11::_1, 3))
                                  .set_to_next_positive(tria.begin_active()),
-                                 FI(std::bind2nd (std::ptr_fun(predicate), 3), tria.end())) ==
+                                 FI(std_cxx11::bind (std::ptr_fun(predicate), std_cxx11::_1, 3), tria.end())) ==
                   static_cast<signed int>(tria.n_active_cells (3))
                   ?
                   "OK" : "Failed")
index 1d3c44523e561a433b590e662f2b447c24a7af6e..e7c0499c3f85fd3113dc737c331ef9845a2ed783 100644 (file)
@@ -139,9 +139,9 @@ void test ()
       bool (*predicate) (const active_cell_iterator, const unsigned int)
         = &level_equal_to<active_cell_iterator>;
       FilteredIterator<active_cell_iterator>
-      begin (std::bind2nd (std::ptr_fun(predicate), 3),
+      begin (std_cxx11::bind (std::ptr_fun(predicate), std_cxx11::_1, 3),
              tria.begin_active (3)),
-                               end   (std::bind2nd (std::ptr_fun(predicate), 3),
+                               end   (std_cxx11::bind (std::ptr_fun(predicate), std_cxx11::_1, 3),
                                       tria.end());
 
       Assert (std::distance (begin, end) ==
@@ -163,15 +163,15 @@ void test ()
 
       bool (*predicate) (const active_cell_iterator, const unsigned int)
         = &level_equal_to<active_cell_iterator>;
-      Assert (std::distance (FI(std::bind2nd (std::ptr_fun(predicate), 3))
+      Assert (std::distance (FI(std_cxx11::bind (std::ptr_fun(predicate), std_cxx11::_1, 3))
                              .set_to_next_positive(tria.begin_active()),
-                             FI(std::bind2nd (std::ptr_fun(predicate), 3), tria.end())) ==
+                             FI(std_cxx11::bind (std::ptr_fun(predicate), std_cxx11::_1, 3), tria.end())) ==
               static_cast<signed int>(tria.n_active_cells (3)),
               ExcInternalError());
       logfile << "Check 4: "
-              << (std::distance (FI(std::bind2nd (std::ptr_fun(predicate), 3))
+              << (std::distance (FI(std_cxx11::bind (std::ptr_fun(predicate), std_cxx11::_1, 3))
                                  .set_to_next_positive(tria.begin_active()),
-                                 FI(std::bind2nd (std::ptr_fun(predicate), 3), tria.end())) ==
+                                 FI(std_cxx11::bind (std::ptr_fun(predicate), std_cxx11::_1, 3), tria.end())) ==
                   static_cast<signed int>(tria.n_active_cells (3))
                   ?
                   "OK" : "Failed")
index 19f12af0852dc98f72d3c2268faa10de4653be8e..b9ba9f10b901ed563630015c586248372a6e4732 100644 (file)
@@ -176,8 +176,9 @@ void test ()
 
       // check std::transform
       std::transform (v1.begin(), v1.end(), v2.begin(),
-                      std::bind2nd (std::multiplies<double>(),
-                                    2.0));
+                      std::bind (std::multiplies<double>(),
+                                 std::placeholders::_1,
+                                 2.0));
       v2 *= 1./2;
       deallog << "Check 7: " << (v1 == v2 ? "true" : "false") << std::endl;
 
index e1a46cb8f50b0044648fcf3a963fde583eedae93..9e9cd815d9c2ebb89804c7f26a16d6cf125b806c 100644 (file)
@@ -176,8 +176,9 @@ void test ()
 
       // check std::transform
       std::transform (v1.begin(), v1.end(), v2.begin(),
-                      std::bind2nd (std::multiplies<std::complex<double> >(),
-                                    2.0));
+                      std::bind (std::multiplies<std::complex<double> >(),
+                                 std_cxx11::_1,
+                                 2.0));
       v2 *= std::complex<double>(1./2.);
       deallog << "Check 7: " << (v1 == v2 ? "true" : "false") << std::endl;
 
index 1263a7448751cc61f0dc9f7e4e5f2ae27332dfeb..377adacadb14dce893d34e2006fca50728386387 100644 (file)
@@ -178,8 +178,9 @@ void test ()
 
       // check std::transform
       std::transform (v1.begin(), v1.end(), v2.begin(),
-                      std::bind2nd (std::multiplies<double>(),
-                                    2.0));
+                      std_cxx11::bind (std::multiplies<double>(),
+                                       std_cxx11::_1
+                                       2.0));
       v2 *= 1./2.;
       deallog << "Check 7: " << (v1 == v2 ? "true" : "false") << std::endl;
 
index dac72ba7b45e2ea62230c83feb06d096cc9aa021..0d9d530aff84dda97d9292bce35f5179f0a779e2 100644 (file)
@@ -179,8 +179,9 @@ void test ()
 
       // check std::transform
       std::transform (v1.begin(), v1.end(), v2.begin(),
-                      std::bind2nd (std::multiplies<double>(),
-                                    2.0));
+                      std::bind (std::multiplies<double>(),
+                                 std_cxx11::_1,
+                                 2.0));
       v2 *= 1./2.;
       deallog << "Check 7: " << (v1 == v2 ? "true" : "false") << std::endl;
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.