From 695ccf26269ee6a1fb18bdce0a568cb29369cf7a Mon Sep 17 00:00:00 2001 From: bangerth Date: Mon, 30 May 2011 00:22:23 +0000 Subject: [PATCH]
  • Changed: deal.II has a namespace std_cxx1x that was used to 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 std 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.
    (Wolfgang Bangerth, 2011/05/29)
  • 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) and #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.
    (Wolfgang Bangerth, 2011/05/29) git-svn-id: https://svn.dealii.org/trunk@23753 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/integrators/cells_and_faces_01.cc | 12 ++++++------ tests/integrators/functional_01.cc | 12 ++++++------ tests/integrators/mesh_worker_01.cc | 6 +++--- tests/multigrid/mg_renumbered_02.cc | 2 +- tests/multigrid/mg_renumbered_03.cc | 2 +- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/tests/integrators/cells_and_faces_01.cc b/tests/integrators/cells_and_faces_01.cc index f00d762e72..c2f706ce1f 100644 --- a/tests/integrators/cells_and_faces_01.cc +++ b/tests/integrators/cells_and_faces_01.cc @@ -113,9 +113,9 @@ test_mesh(MGDoFHandler& mgdofs) MeshWorker::loop, EmptyInfoBox> (dofs.begin_active(), dofs.end(), dof_info, info_box, - std_cxx1x::bind (&Local::cell, local, _1, _2), - std_cxx1x::bind (&Local::bdry, local, _1, _2), - std_cxx1x::bind (&Local::face, local, _1, _2, _3, _4), + std_cxx1x::bind (&Local::cell, local, std_cxx1x::_1, std_cxx1x::_2), + std_cxx1x::bind (&Local::bdry, local, std_cxx1x::_1, std_cxx1x::_2), + std_cxx1x::bind (&Local::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& mgdofs) MeshWorker::loop, EmptyInfoBox> (mgdofs.begin(), mgdofs.end(), mg_dof_info, info_box, - std_cxx1x::bind (&Local::cell, local, _1, _2), - std_cxx1x::bind (&Local::bdry, local, _1, _2), - std_cxx1x::bind (&Local::face, local, _1, _2, _3, _4), + std_cxx1x::bind (&Local::cell, local, std_cxx1x::_1, std_cxx1x::_2), + std_cxx1x::bind (&Local::bdry, local, std_cxx1x::_1, std_cxx1x::_2), + std_cxx1x::bind (&Local::face, local, std_cxx1x::_1, std_cxx1x::_2, std_cxx1x::_3, std_cxx1x::_4), assembler, true); deallog << "MGResults cells"; diff --git a/tests/integrators/functional_01.cc b/tests/integrators/functional_01.cc index daebce27f1..b493a4c3b1 100644 --- a/tests/integrators/functional_01.cc +++ b/tests/integrators/functional_01.cc @@ -96,9 +96,9 @@ test_mesh(MGDoFHandler& mgdofs) MeshWorker::loop, EmptyInfoBox> (dofs.begin_active(), dofs.end(), dof_info, info_box, - std_cxx1x::bind (&Local::cell, local, _1, _2), - std_cxx1x::bind (&Local::bdry, local, _1, _2), - std_cxx1x::bind (&Local::face, local, _1, _2, _3, _4), + std_cxx1x::bind (&Local::cell, local, std_cxx1x::_1, std_cxx1x::_2), + std_cxx1x::bind (&Local::bdry, local, std_cxx1x::_1, std_cxx1x::_2), + std_cxx1x::bind (&Local::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& mgdofs) MeshWorker::loop, EmptyInfoBox> (mgdofs.begin(), mgdofs.end(), mg_dof_info, info_box, - std_cxx1x::bind (&Local::cell, local, _1, _2), - std_cxx1x::bind (&Local::bdry, local, _1, _2), - std_cxx1x::bind (&Local::face, local, _1, _2, _3, _4), + std_cxx1x::bind (&Local::cell, local, std_cxx1x::_1, std_cxx1x::_2), + std_cxx1x::bind (&Local::bdry, local, std_cxx1x::_1, std_cxx1x::_2), + std_cxx1x::bind (&Local::face, local, std_cxx1x::_1, std_cxx1x::_2, std_cxx1x::_3, std_cxx1x::_4), assembler, true); deallog << "MGResults"; diff --git a/tests/integrators/mesh_worker_01.cc b/tests/integrators/mesh_worker_01.cc index 4f96bd71c4..bd25b2be37 100644 --- a/tests/integrators/mesh_worker_01.cc +++ b/tests/integrators/mesh_worker_01.cc @@ -146,9 +146,9 @@ test_simple(MGDoFHandler& mgdofs) MeshWorker::integration_loop (dofs.begin_active(), dofs.end(), dof_info, info_box, - std_cxx1x::bind (&Local::cell, local, _1, _2), - std_cxx1x::bind (&Local::bdry, local, _1, _2), - std_cxx1x::bind (&Local::face, local, _1, _2, _3, _4), + std_cxx1x::bind (&Local::cell, local, std_cxx1x::_1, std_cxx1x::_2), + std_cxx1x::bind (&Local::bdry, local, std_cxx1x::_1, std_cxx1x::_2), + std_cxx1x::bind (&Local::face, local, std_cxx1x::_1, std_cxx1x::_2, std_cxx1x::_3, std_cxx1x::_4), assembler, true); for (unsigned int i=0;i::output_gpl(const MGDoFHandler &dof, MeshWorker::integration_loop ( dof.begin(l), dof.end(l), dof_info, info_box, - std_cxx1x::bind(&OutputCreator::cell, &matrix_integrator, _1, _2), + std_cxx1x::bind(&OutputCreator::cell, &matrix_integrator, std_cxx1x::_1, std_cxx1x::_2), 0, 0, assembler); diff --git a/tests/multigrid/mg_renumbered_03.cc b/tests/multigrid/mg_renumbered_03.cc index 70d2200b43..6cd6afc011 100644 --- a/tests/multigrid/mg_renumbered_03.cc +++ b/tests/multigrid/mg_renumbered_03.cc @@ -297,7 +297,7 @@ LaplaceProblem::output_gpl(const MGDoFHandler &dof, MeshWorker::integration_loop ( dof.begin(l), dof.end(l), dof_info, info_box, - std_cxx1x::bind(&OutputCreator::cell, &matrix_integrator, _1, _2), + std_cxx1x::bind(&OutputCreator::cell, &matrix_integrator, std_cxx1x::_1, std_cxx1x::_2), 0, 0, assembler); -- 2.39.5