]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
<li> Changed: deal.II has a namespace std_cxx1x that was used to
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 30 May 2011 00:22:23 +0000 (00:22 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 30 May 2011 00:22:23 +0000 (00:22 +0000)
import classes from BOOST that are part of the upcoming C++ 1x standard. On
the other hand, if your compiler supported a sufficiently large subset
of C++ 1x, we had code that simply did
@code
  namespace std_cxx1x = std;
@endcode
allowing you to refer to everything that was part of the compiler's namespace
<code>std</code> under the alternative name. This turned out to be untenable
in connection to the changed outlined below for _1, _2, etc. Consequently,
if the compiler used supports C++ 1x, we now selectively import elements of the
compiler's namespace std into namespace std_cxx1x as well. This may lead to
incompatibilities if you are already using elements of the C++ 1x
standard by refering to them through the std_cxx1x namespace and these elements
are not on the list of selectively imported ones.
<br>
(Wolfgang Bangerth, 2011/05/29)

<li> Changed: Previously, placeholder arguments like _1, _2, etc that are used
in conjunction with the std_cxx1x::bind function could be referenced as if
they are part of the global namespace. This was achieved by importing the
corresponding elements of namespace std::placeholders into the global namespace
if your compiler supported this part of the C++ 1x standard, or otherwise using
the BOOST counterparts which are already in the global namespace. However,
this leads to a conflict if one has a C++ 1x enabled compiler (e.g. GCC 4.6)
<i>and</i> #includes certain BOOST headers, since the importation of symbols
into the global namespace now leads to ambiguous names. The only solution to
the problem is to not import names into the global namespace, but rather
import the names from either BOOST or namespace std into the deal.II namespace
std_cxx1x. The downside is that all code that uses _1, _2, etc needs to be
changed to use std_cxx1x::_1, std_cxx1x::_2, etc from now on.
<br>
(Wolfgang Bangerth, 2011/05/29)
</ol>

git-svn-id: https://svn.dealii.org/trunk@23753 0785d39b-7218-0410-832d-ea1e28bc413d

tests/integrators/cells_and_faces_01.cc
tests/integrators/functional_01.cc
tests/integrators/mesh_worker_01.cc
tests/multigrid/mg_renumbered_02.cc
tests/multigrid/mg_renumbered_03.cc

index f00d762e72e66b615585d9deda69dd553c9d5d1c..c2f706ce1f9938be969e407453b20d2b7eea2dfd 100644 (file)
@@ -113,9 +113,9 @@ test_mesh(MGDoFHandler<dim>& mgdofs)
   MeshWorker::loop<dim, dim, MeshWorker::DoFInfo<dim>, EmptyInfoBox>
     (dofs.begin_active(), dofs.end(),
      dof_info, info_box,
-     std_cxx1x::bind (&Local<dim>::cell, local, _1, _2),
-     std_cxx1x::bind (&Local<dim>::bdry, local, _1, _2),
-     std_cxx1x::bind (&Local<dim>::face, local, _1, _2, _3, _4),
+     std_cxx1x::bind (&Local<dim>::cell, local, std_cxx1x::_1, std_cxx1x::_2),
+     std_cxx1x::bind (&Local<dim>::bdry, local, std_cxx1x::_1, std_cxx1x::_2),
+     std_cxx1x::bind (&Local<dim>::face, local, std_cxx1x::_1, std_cxx1x::_2, std_cxx1x::_3, std_cxx1x::_4),
      assembler, true);
 
   deallog << "  Results cells";
@@ -135,9 +135,9 @@ test_mesh(MGDoFHandler<dim>& mgdofs)
   MeshWorker::loop<dim, dim, MeshWorker::DoFInfo<dim>, EmptyInfoBox>
     (mgdofs.begin(), mgdofs.end(),
      mg_dof_info, info_box,
-     std_cxx1x::bind (&Local<dim>::cell, local, _1, _2),
-     std_cxx1x::bind (&Local<dim>::bdry, local, _1, _2),
-     std_cxx1x::bind (&Local<dim>::face, local, _1, _2, _3, _4),
+     std_cxx1x::bind (&Local<dim>::cell, local, std_cxx1x::_1, std_cxx1x::_2),
+     std_cxx1x::bind (&Local<dim>::bdry, local, std_cxx1x::_1, std_cxx1x::_2),
+     std_cxx1x::bind (&Local<dim>::face, local, std_cxx1x::_1, std_cxx1x::_2, std_cxx1x::_3, std_cxx1x::_4),
      assembler, true);
 
   deallog << "MGResults cells";
index daebce27f1f19e77ec72834ee8b834eea82e8308..b493a4c3b15c831efeeed55f733eea641faf65dd 100644 (file)
@@ -96,9 +96,9 @@ test_mesh(MGDoFHandler<dim>& mgdofs)
   MeshWorker::loop<dim, dim, MeshWorker::DoFInfo<dim>, EmptyInfoBox>
     (dofs.begin_active(), dofs.end(),
      dof_info, info_box,
-     std_cxx1x::bind (&Local<dim>::cell, local, _1, _2),
-     std_cxx1x::bind (&Local<dim>::bdry, local, _1, _2),
-     std_cxx1x::bind (&Local<dim>::face, local, _1, _2, _3, _4),
+     std_cxx1x::bind (&Local<dim>::cell, local, std_cxx1x::_1, std_cxx1x::_2),
+     std_cxx1x::bind (&Local<dim>::bdry, local, std_cxx1x::_1, std_cxx1x::_2),
+     std_cxx1x::bind (&Local<dim>::face, local, std_cxx1x::_1, std_cxx1x::_2, std_cxx1x::_3, std_cxx1x::_4),
      assembler, true);
 
   deallog << "  Results";
@@ -111,9 +111,9 @@ test_mesh(MGDoFHandler<dim>& mgdofs)
   MeshWorker::loop<dim, dim, MeshWorker::DoFInfo<dim>, EmptyInfoBox>
     (mgdofs.begin(), mgdofs.end(),
      mg_dof_info, info_box,
-     std_cxx1x::bind (&Local<dim>::cell, local, _1, _2),
-     std_cxx1x::bind (&Local<dim>::bdry, local, _1, _2),
-     std_cxx1x::bind (&Local<dim>::face, local, _1, _2, _3, _4),
+     std_cxx1x::bind (&Local<dim>::cell, local, std_cxx1x::_1, std_cxx1x::_2),
+     std_cxx1x::bind (&Local<dim>::bdry, local, std_cxx1x::_1, std_cxx1x::_2),
+     std_cxx1x::bind (&Local<dim>::face, local, std_cxx1x::_1, std_cxx1x::_2, std_cxx1x::_3, std_cxx1x::_4),
      assembler, true);
 
   deallog << "MGResults";
index 4f96bd71c40339df4fb5cb0df9a4657661e25af2..bd25b2be3781bca0aa4cacde104ff594aa25b6c8 100644 (file)
@@ -146,9 +146,9 @@ test_simple(MGDoFHandler<dim>& mgdofs)
   MeshWorker::integration_loop<dim, dim>
     (dofs.begin_active(), dofs.end(),
      dof_info, info_box,
-     std_cxx1x::bind (&Local<dim>::cell, local, _1, _2),
-       std_cxx1x::bind (&Local<dim>::bdry, local, _1, _2),
-       std_cxx1x::bind (&Local<dim>::face, local, _1, _2, _3, _4),
+     std_cxx1x::bind (&Local<dim>::cell, local, std_cxx1x::_1, std_cxx1x::_2),
+       std_cxx1x::bind (&Local<dim>::bdry, local, std_cxx1x::_1, std_cxx1x::_2),
+       std_cxx1x::bind (&Local<dim>::face, local, std_cxx1x::_1, std_cxx1x::_2, std_cxx1x::_3, std_cxx1x::_4),
        assembler, true);
   
   for (unsigned int i=0;i<v.size();++i)
index bc5ef54633bd2175d74aae1292647790de933344..03cdfe43aff59126b51890ea43cd7e4dd2b740ea 100644 (file)
@@ -250,7 +250,7 @@ LaplaceProblem<dim>::output_gpl(const MGDoFHandler<dim> &dof,
     MeshWorker::integration_loop<dim, dim> (
       dof.begin(l), dof.end(l),
       dof_info, info_box,
-      std_cxx1x::bind(&OutputCreator<dim>::cell, &matrix_integrator, _1, _2),
+      std_cxx1x::bind(&OutputCreator<dim>::cell, &matrix_integrator, std_cxx1x::_1, std_cxx1x::_2),
       0,
       0,
       assembler);
index 70d2200b439facaab5c8833f95e83b03e7a7e680..6cd6afc0114cf90bc7ab1697850491e7f029dde1 100644 (file)
@@ -297,7 +297,7 @@ LaplaceProblem<dim>::output_gpl(const MGDoFHandler<dim> &dof,
     MeshWorker::integration_loop<dim, dim> (
       dof.begin(l), dof.end(l),
       dof_info, info_box,
-      std_cxx1x::bind(&OutputCreator<dim>::cell, &matrix_integrator, _1, _2),
+      std_cxx1x::bind(&OutputCreator<dim>::cell, &matrix_integrator, std_cxx1x::_1, std_cxx1x::_2),
       0,
       0,
       assembler);

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.