]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Remove bind2nd calls in source
authorJonathan Robey <class4kayaker@gmail.com>
Thu, 28 Jul 2016 17:46:49 +0000 (10:46 -0700)
committerJonathan Robey <class4kayaker@gmail.com>
Thu, 28 Jul 2016 21:36:21 +0000 (14:36 -0700)
12 files changed:
source/distributed/grid_refinement.cc
source/dofs/dof_tools_constraints.cc
source/fe/fe.cc
source/grid/grid_in.cc
source/grid/grid_reordering.cc
source/grid/tria.cc
source/grid/tria_objects.cc
source/hp/dof_handler.cc
source/lac/sparsity_pattern.cc
source/lac/sparsity_tools.cc
source/multigrid/mg_transfer_block.cc
source/multigrid/mg_transfer_component.cc

index 0c772583a86f6b899987a45203bd00c9b3d5a700..b599a59d18e2d379a7321216cef6cf38ef0c26bf 100644 (file)
@@ -294,8 +294,9 @@ namespace
           unsigned int
           my_count = std::count_if (criteria.begin(),
                                     criteria.end(),
-                                    std::bind2nd (std::greater<double>(),
-                                                  test_threshold));
+                                    std_cxx11::bind (&std::greater<double>,
+                                                     std_cxx11::_1,
+                                                     test_threshold));
 
           unsigned int total_count;
           MPI_Reduce (&my_count, &total_count, 1, MPI_UNSIGNED,
index 8cb4a96b87724ae2228d8d99007a6a34ee6a0eb0..84fa2ff72db7f21e0ffcc5556c756f99c76613c6 100644 (file)
@@ -3199,7 +3199,7 @@ namespace DoFTools
     // now compute the requested representation
     const types::global_dof_index n_global_parm_dofs
       = std::count_if (weight_mapping.begin(), weight_mapping.end(),
-                       std::bind2nd (std::not_equal_to<types::global_dof_index> (), numbers::invalid_dof_index));
+                       std_cxx11::bind (std::not_equal_to<types::global_dof_index>(), std_cxx11::_1, numbers::invalid_dof_index));
 
     // first construct the inverse mapping of weight_mapping
     std::vector<types::global_dof_index> inverse_weight_mapping (n_global_parm_dofs,
index a1f110493d2ad084e54033cebee17c1374e33e5d..c55b400ae603c407272bb6fae9536958ef909f56 100644 (file)
@@ -89,8 +89,9 @@ FiniteElement (const FiniteElementData<dim> &fe_data,
 {
   this->set_primitivity(std::find_if (n_nonzero_components_table.begin(),
                                       n_nonzero_components_table.end(),
-                                      std::bind2nd(std::not_equal_to<unsigned int>(),
-                                                   1U))
+                                      std_cxx11::bind (std::not_equal_to<unsigned int>(),
+                                                       std_cxx11::_1,
+                                                       1U))
                         == n_nonzero_components_table.end());
 
 
index d45513556e281981028ad45594818039e6d85aca..95d71d46c0ee8a2cd0b66336ee4b1182142211da 100644 (file)
@@ -2530,7 +2530,7 @@ void GridIn<dim, spacedim>::skip_empty_lines (std::istream &in)
       // if not put the whole thing
       // back and return
       if (std::find_if (line.begin(), line.end(),
-                        std::bind2nd (std::not_equal_to<char>(),' '))
+                        std_cxx11::bind (std::not_equal_to<char>(),std_cxx11::_1,' '))
           != line.end())
         {
           in.putback ('\n');
index 95b9da28c79e3472d228615d831cccd443559507..6bdfed9d340dcd59596381ea83d8f6dd66103227 100644 (file)
@@ -352,7 +352,7 @@ namespace internal
       for (int i = 0; i<4; ++i)
         {
           std::transform(inquads.begin(),inquads.end(),
-                         std::back_inserter(sides), std::bind2nd(QuadSide(),i));
+                         std::back_inserter(sides), std_cxx11::bind(QuadSide(),std_cxx11::_1,i));
         }
 
       //Change each edge so that v0<v1
index 31b117337ef0bb3581635b2111f3ad49b184c722..1f3629c7e0afd5a4af3b15d376fca707519a3ab0 100644 (file)
@@ -4419,7 +4419,7 @@ namespace internal
             const unsigned int used_cells
               =  std::count_if (triangulation.levels[level+1]->cells.used.begin(),
                                 triangulation.levels[level+1]->cells.used.end(),
-                                std::bind2nd (std::equal_to<bool>(), true));
+                                std_cxx11::bind (std::equal_to<bool>(), std_cxx11::_1, true));
 
             // reserve space for the used_cells cells already existing
             // on the next higher level as well as for the
@@ -4444,8 +4444,9 @@ namespace internal
         // vertices are already in use
         needed_vertices += std::count_if (triangulation.vertices_used.begin(),
                                           triangulation.vertices_used.end(),
-                                          std::bind2nd (std::equal_to<bool>(),
-                                                        true));
+                                          std_cxx11::bind (std::equal_to<bool>(),
+                                                           std_cxx11::_1,
+                                                           true));
         // if we need more vertices: create them, if not: leave the
         // array as is, since shrinking is not really possible because
         // some of the vertices at the end may be in use
@@ -4741,7 +4742,7 @@ namespace internal
             const unsigned int used_cells
               = std::count_if (triangulation.levels[level+1]->cells.used.begin(),
                                triangulation.levels[level+1]->cells.used.end(),
-                               std::bind2nd (std::equal_to<bool>(), true));
+                               std_cxx11::bind (std::equal_to<bool>(), std_cxx11::_1, true));
 
 
             // reserve space for the used_cells cells already existing
@@ -4777,7 +4778,7 @@ namespace internal
 
         // add to needed vertices how many vertices are already in use
         needed_vertices += std::count_if (triangulation.vertices_used.begin(), triangulation.vertices_used.end(),
-                                          std::bind2nd (std::equal_to<bool>(), true));
+                                          std_cxx11::bind (std::equal_to<bool>(), std_cxx11::_1, true));
         // if we need more vertices: create them, if not: leave the
         // array as is, since shrinking is not really possible because
         // some of the vertices at the end may be in use
@@ -5146,7 +5147,7 @@ namespace internal
             const unsigned int used_cells
               = std::count_if (triangulation.levels[level+1]->cells.used.begin(),
                                triangulation.levels[level+1]->cells.used.end(),
-                               std::bind2nd (std::equal_to<bool>(), true));
+                               std_cxx11::bind (std::equal_to<bool>(), std_cxx11::_1, true));
 
 
             // reserve space for the used_cells cells already existing
@@ -5221,7 +5222,7 @@ namespace internal
 
         // add to needed vertices how many vertices are already in use
         needed_vertices += std::count_if (triangulation.vertices_used.begin(), triangulation.vertices_used.end(),
-                                          std::bind2nd (std::equal_to<bool>(), true));
+                                          std_cxx11::bind (std::equal_to<bool>(), std_cxx11::_1, true));
         // if we need more vertices: create them, if not: leave the
         // array as is, since shrinking is not really possible because
         // some of the vertices at the end may be in use
@@ -11709,7 +11710,7 @@ unsigned int
 Triangulation<dim, spacedim>::n_used_vertices () const
 {
   return std::count_if (vertices_used.begin(), vertices_used.end(),
-                        std::bind2nd (std::equal_to<bool>(), true));
+                        std_cxx11::bind (std::equal_to<bool>(), std_cxx11::_1, true));
 }
 
 
index 0beb8f79f00ffa6f68cafe8571134f5d4337617a..41f1bd9ea46d3f8b39acad2b2ca7735affed4d15 100644 (file)
@@ -14,6 +14,7 @@
 // ---------------------------------------------------------------------
 
 #include <deal.II/base/memory_consumption.h>
+#include <deal.II/base/std_cxx11/bind.h>
 #include <deal.II/grid/tria_objects.h>
 #include <deal.II/grid/tria.h>
 #include <deal.II/grid/tria_iterator.h>
@@ -170,7 +171,7 @@ namespace internal
       const unsigned int new_size = new_hexes +
                                     std::count_if (used.begin(),
                                                    used.end(),
-                                                   std::bind2nd (std::equal_to<bool>(), true));
+                                                   std_cxx11::bind (std::equal_to<bool>(), std_cxx11::_1, true));
 
       // see above...
       if (new_size>cells.size())
index da115ac68c79c47156847d34c3e6b9e4cbc962d6..097e0ec4bb5d35e1c3bb4d455cb90aa6d1aef48e 100644 (file)
@@ -3235,13 +3235,16 @@ namespace hp
           std::transform (tria->levels[i]->cells.children.begin (),
                           tria->levels[i]->cells.children.end (),
                           has_children_level->begin (),
-                          std::bind2nd (std::not_equal_to<int>(), -1));
+                          std_cxx11::bind(std::not_equal_to<int>(),
+                                          std_cxx11::_1,
+                                          -1));
         else
           std::transform (tria->levels[i]->cells.refinement_cases.begin (),
                           tria->levels[i]->cells.refinement_cases.end (),
                           has_children_level->begin (),
-                          std::bind2nd (std::not_equal_to<unsigned char>(),
-                                        static_cast<unsigned char>(RefinementCase<dim>::no_refinement)));
+                          std_cxx11::bind (std::not_equal_to<unsigned char>(),
+                                           std_cxx11::_1,
+                                           static_cast<unsigned char>(RefinementCase<dim>::no_refinement)));
 
         has_children.push_back (has_children_level);
       }
index 79dbf8b04decbf07513a3a6c6d4510dc88da3752..b7d60c7cce84061d5b377524e4e6e5cab563f306 100644 (file)
@@ -397,7 +397,7 @@ SparsityPattern::compress ()
   const std::size_t nonzero_elements
     = std::count_if (&colnums[rowstart[0]],
                      &colnums[rowstart[rows]],
-                     std::bind2nd(std::not_equal_to<size_type>(), invalid_entry));
+                     std_cxx11::bind(std::not_equal_to<size_type>(), std_cxx11::_1, invalid_entry));
   // now allocate the respective memory
   size_type *new_colnums = new size_type[nonzero_elements];
 
index c7a77cab53a33a57338d6141abbbc76f951075be..55cc166cdb44ab6f7e395b61ddc251c56c5016cd 100644 (file)
@@ -226,8 +226,9 @@ namespace SparsityTools
         last_round_dofs[i] = numbers::invalid_size_type;
 
     std::remove_if (last_round_dofs.begin(), last_round_dofs.end(),
-                    std::bind2nd(std::equal_to<DynamicSparsityPattern::size_type>(),
-                                 numbers::invalid_size_type));
+                    std_cxx11::bind(std::equal_to<DynamicSparsityPattern::size_type>(),
+                                    std_cxx11::_1,
+                                    numbers::invalid_size_type));
 
     // now if no valid points remain: find dof with lowest coordination number
     if (last_round_dofs.empty())
index 67a97e29dee848ccc71a52d4dee0f1fe3671d1b0..05ab9872cbc4c59b7cac26ef1402588703c3923a 100644 (file)
@@ -527,8 +527,9 @@ void MGTransferBlockSelect<number>::build_matrices (
       // copy_indices.
       const types::global_dof_index n_active_dofs =
         std::count_if (temp_copy_indices.begin(), temp_copy_indices.end(),
-                       std::bind2nd(std::not_equal_to<types::global_dof_index>(),
-                                    numbers::invalid_dof_index));
+                       std_cxx11::bind (std::not_equal_to<types::global_dof_index>(),
+                                        std_cxx11::_1,
+                                        numbers::invalid_dof_index));
       copy_indices[selected_block][level].resize (n_active_dofs);
       types::global_dof_index counter = 0;
       for (types::global_dof_index i=0; i<temp_copy_indices.size(); ++i)
@@ -607,8 +608,9 @@ void MGTransferBlock<number>::build_matrices (
             const types::global_dof_index n_active_dofs =
               std::count_if (temp_copy_indices[block].begin(),
                              temp_copy_indices[block].end(),
-                             std::bind2nd(std::not_equal_to<types::global_dof_index>(),
-                                          numbers::invalid_dof_index));
+                             std_cxx11::bind (std::not_equal_to<types::global_dof_index>(),
+                                              std_cxx11::_1,
+                                              numbers::invalid_dof_index));
             copy_indices[block][level].resize (n_active_dofs);
             types::global_dof_index counter = 0;
             for (types::global_dof_index i=0; i<temp_copy_indices[block].size(); ++i)
index 8f61f8f34a3fe6ffec84acfb0e82cdf8e04dd502..9a860265b21be7d910ff36028de142ce77bc1a97 100644 (file)
@@ -668,8 +668,9 @@ void MGTransferSelect<number>::build_matrices (
       // global to level dofs
       const types::global_dof_index n_active_dofs =
         std::count_if (temp_copy_indices.begin(), temp_copy_indices.end(),
-                       std::bind2nd(std::not_equal_to<types::global_dof_index>(),
-                                    numbers::invalid_dof_index));
+                       std_cxx11::bind (std::not_equal_to<types::global_dof_index>(),
+                                        std_cxx11::_1,
+                                        numbers::invalid_dof_index));
       copy_to_and_from_indices[level].resize (n_active_dofs);
       types::global_dof_index counter = 0;
       for (types::global_dof_index i=0; i<temp_copy_indices.size(); ++i)

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.