From 5030155ad0c4b7ad637ff2a773e68c05d7e08f49 Mon Sep 17 00:00:00 2001 From: Lei Qiao Date: Wed, 14 Oct 2015 13:01:34 -0500 Subject: [PATCH] define namespace dealii::std_cxx11::placeholders --- include/deal.II/base/std_cxx11/bind.h | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/include/deal.II/base/std_cxx11/bind.h b/include/deal.II/base/std_cxx11/bind.h index 505023d3fd..b6e54707db 100644 --- a/include/deal.II/base/std_cxx11/bind.h +++ b/include/deal.II/base/std_cxx11/bind.h @@ -24,10 +24,13 @@ # include DEAL_II_NAMESPACE_OPEN -// in boost, the placeholders _1, _2, ... are in the global namespace. in -// C++0x, they are in namespace std::placeholders, which makes them awkward to -// use. import them into the deal.II::std_cxx11 namespace instead and do them -// same below if we use boost instead. +// In boost, the placeholders _1, _2, ... are in the global namespace. In +// C++11, they are in namespace std::placeholders, which makes them awkward to +// use. Import them into the dealii::std_cxx11 namespace instead and do them +// same below if we use boost instead. Namespace 'placeholders' is also defined +// in dealii::std_cxx11 namespace to make code C++ standard compatible. +// That is to say, if std::something works with C++11 standard, +// then dealii::std_cxx11::something should also work. namespace std_cxx11 { using namespace std::placeholders; @@ -35,6 +38,8 @@ namespace std_cxx11 using std::ref; using std::cref; using std::reference_wrapper; + + namespace placeholders = std::placeholders; } DEAL_II_NAMESPACE_CLOSE @@ -61,6 +66,19 @@ namespace std_cxx11 using ::_7; using ::_8; using ::_9; + + namespace placeholders + { + using ::_1; + using ::_2; + using ::_3; + using ::_4; + using ::_5; + using ::_6; + using ::_7; + using ::_8; + using ::_9; + } } DEAL_II_NAMESPACE_CLOSE -- 2.39.5